Skip to content

[video_player] Duration update during HLS live stream #178280

@Andro999b

Description

@Andro999b

Use case

HLS live streams

Proposal

Current version of video_player does allow to update duration value during playback. That lead to an issue when user can`t properly seek in video stream. Since initial duration is 0. As workaround buffered value can be used to as duration. But this is a hacky solution.

Here is 2 options to address this issue:

1

add new VideoEventType: durationUpdate. That will allow VideoPlatformInterface implementation update duration when it needs

2

Change bufferingUpdate handler:

Duration newDuration = event.duration ?? value.duration;
if (newDuration < event.buffered) {
   newDuration = event.buffered;
}
value = value.copyWith(buffered: event.buffered);

Metadata

Metadata

Assignees

No one assigned

    Labels

    r: duplicateIssue is closed as a duplicate of an existing issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions