-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[video_player] Implement screen auto-lock control for video playback #11225
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 6 commits
fed4658
f688bdb
3c60307
46ea3e9
74b02a4
dffa3a4
742e1b5
263bdc5
04f9b57
15d7d64
b30287e
2b353a9
da08c54
6353082
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 |
|---|---|---|
|
|
@@ -39,3 +39,10 @@ dev_dependencies: | |
| topics: | ||
| - video | ||
| - video-player | ||
|
|
||
|
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. According to the repository style guide, temporary References
|
||
| dependency_overrides: | ||
| video_player_avfoundation: | ||
| path: ../video_player_avfoundation | ||
| video_player_platform_interface: | ||
| path: ../video_player_platform_interface | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,7 @@ | ||
| ## 2.9.5 | ||
|
|
||
| * Implement screen auto-lock control for video playback. | ||
|
||
|
|
||
| ## 2.9.4 | ||
|
|
||
| * Ensures that the display link does not continue requesting frames after a player is disposed. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -508,6 +508,12 @@ - (void)selectAudioTrackAtIndex:(NSInteger)trackIndex | |
| } | ||
| } | ||
|
|
||
| - (void)setAllowScreenAutoLock:(BOOL)allowScreenAutoLock error:(FlutterError *_Nullable *_Nonnull)error { | ||
| if (@available(iOS 12.0, *)) { | ||
| self.player.preventsDisplaySleepDuringVideoPlayback = !allowScreenAutoLock; | ||
|
||
| } | ||
shrabanti722 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| #pragma mark - Private | ||
|
|
||
| - (int64_t)duration { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,7 @@ name: video_player_avfoundation | |
| description: iOS and macOS implementation of the video_player plugin. | ||
| repository: https://github.com/flutter/packages/tree/main/packages/video_player/video_player_avfoundation | ||
| issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+video_player%22 | ||
| version: 2.9.4 | ||
| version: 2.9.5 | ||
|
|
||
| environment: | ||
| sdk: ^3.10.0 | ||
|
|
@@ -36,3 +36,8 @@ dev_dependencies: | |
| topics: | ||
| - video | ||
| - video-player | ||
|
|
||
| dependency_overrides: | ||
|
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. According to the repository style guide, temporary References
|
||
| video_player_platform_interface: | ||
| path: ../video_player_platform_interface | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.