-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[video_player_platform_interface] Add preventsDisplaySleepDuringVideoPlayback option #11546
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 | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -124,6 +124,16 @@ abstract class VideoPlayerPlatform extends PlatformInterface { | |||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| /// Sets whether the screen is prevented from sleeping during video playback. | ||||||||||||||||||||||||||||||
| Future<void> setPreventsDisplaySleepDuringVideoPlayback( | ||||||||||||||||||||||||||||||
| int playerId, | ||||||||||||||||||||||||||||||
| bool preventsDisplaySleepDuringVideoPlayback, | ||||||||||||||||||||||||||||||
| ) { | ||||||||||||||||||||||||||||||
| throw UnimplementedError( | ||||||||||||||||||||||||||||||
| 'setPreventsDisplaySleepDuringVideoPlayback() has not been implemented.', | ||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
Comment on lines
+128
to
+135
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. For consistency with other methods in this class (such as
Suggested change
|
||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| /// Sets additional options on web. | ||||||||||||||||||||||||||||||
| Future<void> setWebOptions(int playerId, VideoPlayerWebOptions options) { | ||||||||||||||||||||||||||||||
| throw UnimplementedError('setWebOptions() has not been implemented.'); | ||||||||||||||||||||||||||||||
|
|
@@ -435,6 +445,7 @@ class VideoPlayerOptions { | |||||||||||||||||||||||||||||
| VideoPlayerOptions({ | ||||||||||||||||||||||||||||||
| this.mixWithOthers = false, | ||||||||||||||||||||||||||||||
| this.allowBackgroundPlayback = false, | ||||||||||||||||||||||||||||||
| this.preventsDisplaySleepDuringVideoPlayback = true, | ||||||||||||||||||||||||||||||
| this.webOptions, | ||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
|
|
@@ -449,6 +460,13 @@ class VideoPlayerOptions { | |||||||||||||||||||||||||||||
| /// currently no way to implement this feature in this platform). | ||||||||||||||||||||||||||||||
| final bool mixWithOthers; | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| /// Whether the screen is prevented from sleeping during video playback. | ||||||||||||||||||||||||||||||
| /// | ||||||||||||||||||||||||||||||
| /// Defaults to `true`. | ||||||||||||||||||||||||||||||
| /// | ||||||||||||||||||||||||||||||
| /// This option is currently only supported on iOS and macOS. | ||||||||||||||||||||||||||||||
| final bool preventsDisplaySleepDuringVideoPlayback; | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| /// Additional web controls | ||||||||||||||||||||||||||||||
| final VideoPlayerWebOptions? webOptions; | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.