-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[video_player] Fixed HLS streams on iOS (#48760) #3048
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -757,12 +757,12 @@ class _VideoProgressIndicatorState extends State<VideoProgressIndicator> { | |
| fit: StackFit.passthrough, | ||
| children: <Widget>[ | ||
| LinearProgressIndicator( | ||
| value: maxBuffering / duration, | ||
| value: duration > 0 ? maxBuffering / duration : 0, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it possible to cover the crashy behavior with a test?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does duration 0 means it's indefinite? if so should we use null for value to show an indefinite progress indicator?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's 0 on iOS. Android returns different values
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we have an indication on Android that it's indefinite? what does the progress bar show for indefinite streams on Android?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The exoPlayer does have a isDynamic function on the Window. This is set to true when a Live stream is being played. I believe this would be the best solution. Link to the docs.. I could implement a VideoPlayerController().isDurationIndefinite getter that returns true when ExoPlayer returns true on the isDynamic getter on Android, and when isDurationIndefinite returns true on iOS? |
||
| valueColor: AlwaysStoppedAnimation<Color>(colors.bufferedColor), | ||
| backgroundColor: colors.backgroundColor, | ||
| ), | ||
| LinearProgressIndicator( | ||
| value: position / duration, | ||
| value: duration > 0 ? position / duration : 0, | ||
| valueColor: AlwaysStoppedAnimation<Color>(colors.playedColor), | ||
| backgroundColor: Colors.transparent, | ||
| ), | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cyanglaz any hints on how to test cover this?