Skip to content

Commit 366a896

Browse files
fix: stop force disable wakelock
This commit addresses the issue where chewie will force disable wakelock without taking into account that other packages / app parts might depend on the same package
1 parent 43ab7d6 commit 366a896

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/src/chewie_player.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,9 @@ class ChewieState extends State<Chewie> {
168168
_isFullScreen = false;
169169
widget.controller.exitFullScreen();
170170

171-
// The wakelock plugins checks whether it needs to perform an action internally,
172-
// so we do not need to check WakelockPlus.isEnabled.
173-
WakelockPlus.disable();
171+
if (!widget.controller.allowedScreenSleep) {
172+
WakelockPlus.disable();
173+
}
174174

175175
SystemChrome.setEnabledSystemUIMode(
176176
SystemUiMode.manual,

0 commit comments

Comments
 (0)