-
Notifications
You must be signed in to change notification settings - Fork 3.8k
[video_player_platform_interface] Improve seek performance on Android #11932
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
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 |
|---|---|---|
|
|
@@ -472,7 +472,11 @@ class VideoPlayerOptions { | |
| this.allowBackgroundPlayback = false, | ||
| this.preventsDisplaySleepDuringVideoPlayback = true, | ||
| this.webOptions, | ||
| }); | ||
| this.backBufferDurationMs, | ||
| }) : assert( | ||
| backBufferDurationMs == null || backBufferDurationMs >= 0, | ||
| 'backBufferDurationMs must be zero or greater', | ||
| ); | ||
|
sailendrabathi marked this conversation as resolved.
|
||
|
|
||
| /// Set this to true to keep playing video in background, when app goes in background. | ||
| /// The default value is false. | ||
|
|
@@ -494,6 +498,12 @@ class VideoPlayerOptions { | |
|
|
||
| /// Additional web controls | ||
| final VideoPlayerWebOptions? webOptions; | ||
|
|
||
| /// ** Android only **. Sets ExoPlayer's back buffer duration in milliseconds. | ||
|
Collaborator
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. We don't make assertions about what platforms implement something in platform interface packgaes, because this package doesn't control that. What if a third-party implementation for another platform supports it, for instance? Or it's added to iOS later, without any change to this package? We also don't describe behavior in terms of underlying SDK details unless there's no other way to. This comment should describe what the back buffer is, conceptually, without reference to ExoPlayer. |
||
| /// | ||
| /// This is not possible on iOS because AVPlayer does not provide a way to | ||
| /// configure the back buffer duration. | ||
|
Collaborator
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. Same here. You can say "Ignored on platforms that do not support controlling the back buffer.", which is both generic to other implementations, and future-proof.
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. I was going to say this, but I figured once the interface is reworked to use the new standard of
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. but Stuart is right, that is protocol
Collaborator
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 not just protocol; this class is directly re-exported from the app-facing package currently, so these will be client-facing docs as soon as they land. |
||
| final int? backBufferDurationMs; | ||
|
mboetger marked this conversation as resolved.
|
||
| } | ||
|
|
||
| /// [VideoPlayerWebOptions] can be optionally used to set additional web settings | ||
|
|
@@ -593,13 +603,20 @@ class VideoViewOptions { | |
| @immutable | ||
| class VideoCreationOptions { | ||
| /// Constructs an instance of [VideoCreationOptions]. | ||
| const VideoCreationOptions({required this.dataSource, required this.viewType}); | ||
| const VideoCreationOptions({ | ||
| required this.dataSource, | ||
| required this.viewType, | ||
| this.videoPlayerOptions, | ||
| }); | ||
|
|
||
| /// The data source used to create the player. | ||
| final DataSource dataSource; | ||
|
|
||
| /// The type of view to be used for displaying the video player | ||
| final VideoViewType viewType; | ||
|
|
||
| /// Additional configuration options for the video player. | ||
| final VideoPlayerOptions? videoPlayerOptions; | ||
|
Collaborator
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. Composing the two different options classes seems potentially confusing, but it doesn't look like the API surface ever clearly distinguished these conceptually. Since @tarrinneal As part of revisiting the |
||
| } | ||
|
|
||
| /// Represents an audio track in a video with its metadata. | ||
|
|
||
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.
Same here; don't reference ExoPlayer or Android.