mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-07 21:48:14 -08:00
fix: WakeLock calls now get called properly (#177)
Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
parent
5acce21261
commit
c6080824d7
2 changed files with 7 additions and 6 deletions
|
|
@ -146,11 +146,6 @@ class MediaControlsWrapper extends BaseAudioHandler {
|
|||
updatePosition: value.position,
|
||||
));
|
||||
smtc?.setPosition(value.position);
|
||||
if (value.playing) {
|
||||
WakelockPlus.enable();
|
||||
} else {
|
||||
WakelockPlus.disable();
|
||||
}
|
||||
playbackState.add(playbackState.value.copyWith(
|
||||
playing: value.playing,
|
||||
));
|
||||
|
|
@ -160,6 +155,7 @@ class MediaControlsWrapper extends BaseAudioHandler {
|
|||
|
||||
@override
|
||||
Future<void> play() async {
|
||||
WakelockPlus.enable();
|
||||
_player?.play();
|
||||
if (!ref.read(clientSettingsProvider).enableMediaKeys) return;
|
||||
|
||||
|
|
@ -248,6 +244,11 @@ class MediaControlsWrapper extends BaseAudioHandler {
|
|||
playing: _player?.lastState.playing ?? false,
|
||||
controls: [MediaControl.play],
|
||||
));
|
||||
if (playbackState.value.playing) {
|
||||
WakelockPlus.enable();
|
||||
} else {
|
||||
WakelockPlus.disable();
|
||||
}
|
||||
final playerState = _player;
|
||||
if (playerState != null) {
|
||||
ref
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ class LibMPV extends BasePlayer {
|
|||
: Video(
|
||||
key: key,
|
||||
controller: _controller!,
|
||||
wakelock: true,
|
||||
wakelock: false,
|
||||
fill: Colors.transparent,
|
||||
fit: fit,
|
||||
subtitleViewConfiguration: const SubtitleViewConfiguration(visible: false),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue