-
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 |
|---|---|---|
|
|
@@ -462,7 +462,11 @@ class VideoPlayerOptions { | |
| this.mixWithOthers = false, | ||
| this.allowBackgroundPlayback = false, | ||
| 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. | ||
|
|
@@ -477,6 +481,9 @@ class VideoPlayerOptions { | |
|
|
||
| /// Additional web controls | ||
| final VideoPlayerWebOptions? webOptions; | ||
|
|
||
| /// **Android only**. Sets ExoPlayer's back buffer duration in milliseconds. | ||
| final int? backBufferDurationMs; | ||
|
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. If you're asserting it must be non-null, why allow it to be nullable?
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 assert is that it can be null or non negative. i.e cannot be a non-null negative number |
||
| } | ||
|
|
||
| /// [VideoPlayerWebOptions] can be optionally used to set additional web settings | ||
|
|
@@ -576,13 +583,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; | ||
| } | ||
|
|
||
| /// 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.
On non-android implementations, isn't it going to be null?
Uh oh!
There was an error while loading. Please reload this page.
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.
I didn't get you... the assert is that is should be null or non-negative. i.e it cannot be a non-null negative number