Skip to content

[video_player] Standardize support for "infinite" (live) streams. #107882

@ditman

Description

@ditman

Use case

The current implementation for the video player plugin has some problems with live streams (videos with "infinite"/unknown/unset duration).

Cross-platform TIME_UNSET

TIME_UNSET is the value used as the "length" of a live video. Its current value comes from ExoPlayer2 directly (C.TIME_UNSET). They had good reasons to pick that value.

The same value was reused when improving the live video features in the iOS implementation, so both platforms would behave the same.

When the Web platform attempted to reuse that same magic value; it was too "wide" to be represented exactly by JavaScript, so we needed to use another one.

  • Ensure that all the mobile implementations start returning what the web is returning: -(2^53) + 2, or -9007199254740990. Note: this is a breaking change!

Provided UI Widgets

package:video_player provides a bunch of Widgets that render different parts of the UI of a Video player, like the _VideoScrubber, the VideoProgressIndicator (and maybe others).

Currently, they all seem to behave as if the duration of the video was always finite, and positive.

  • Update UI Widgets to support TIME_UNSET durations.

Player logic

Most of the player logic assumes that the video has a finite duration, and uses the duration coming from the video controller to do things like:

  • handle the VideoEventType.completed event to seek "to the end"
  • validate if a video can be seekTo'd to a given position (only if 0 < position < duration)

Finally,

  • Check that the player logic handles well TIME_UNSET durations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listp: video_playerThe Video Player pluginpackageflutter/packages repository. See also p: labels.platform-androidAndroid applications specificallyplatform-iosiOS applications specificallyteam-ecosystemOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions