mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-10 07:50:28 -07: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,
|
updatePosition: value.position,
|
||||||
));
|
));
|
||||||
smtc?.setPosition(value.position);
|
smtc?.setPosition(value.position);
|
||||||
if (value.playing) {
|
|
||||||
WakelockPlus.enable();
|
|
||||||
} else {
|
|
||||||
WakelockPlus.disable();
|
|
||||||
}
|
|
||||||
playbackState.add(playbackState.value.copyWith(
|
playbackState.add(playbackState.value.copyWith(
|
||||||
playing: value.playing,
|
playing: value.playing,
|
||||||
));
|
));
|
||||||
|
|
@ -160,6 +155,7 @@ class MediaControlsWrapper extends BaseAudioHandler {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<void> play() async {
|
Future<void> play() async {
|
||||||
|
WakelockPlus.enable();
|
||||||
_player?.play();
|
_player?.play();
|
||||||
if (!ref.read(clientSettingsProvider).enableMediaKeys) return;
|
if (!ref.read(clientSettingsProvider).enableMediaKeys) return;
|
||||||
|
|
||||||
|
|
@ -248,6 +244,11 @@ class MediaControlsWrapper extends BaseAudioHandler {
|
||||||
playing: _player?.lastState.playing ?? false,
|
playing: _player?.lastState.playing ?? false,
|
||||||
controls: [MediaControl.play],
|
controls: [MediaControl.play],
|
||||||
));
|
));
|
||||||
|
if (playbackState.value.playing) {
|
||||||
|
WakelockPlus.enable();
|
||||||
|
} else {
|
||||||
|
WakelockPlus.disable();
|
||||||
|
}
|
||||||
final playerState = _player;
|
final playerState = _player;
|
||||||
if (playerState != null) {
|
if (playerState != null) {
|
||||||
ref
|
ref
|
||||||
|
|
|
||||||
|
|
@ -156,7 +156,7 @@ class LibMPV extends BasePlayer {
|
||||||
: Video(
|
: Video(
|
||||||
key: key,
|
key: key,
|
||||||
controller: _controller!,
|
controller: _controller!,
|
||||||
wakelock: true,
|
wakelock: false,
|
||||||
fill: Colors.transparent,
|
fill: Colors.transparent,
|
||||||
fit: fit,
|
fit: fit,
|
||||||
subtitleViewConfiguration: const SubtitleViewConfiguration(visible: false),
|
subtitleViewConfiguration: const SubtitleViewConfiguration(visible: false),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue