From 63e1d97536a34befd40232d24f755ce6053e6ec6 Mon Sep 17 00:00:00 2001 From: 1hitsong <3330318+1hitsong@users.noreply.github.com> Date: Wed, 26 Apr 2023 17:37:15 -0400 Subject: [PATCH] Toggle disableScreenSaver based on audio state Fixes #1230 --- components/mediaPlayers/AudioPlayer.brs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/mediaPlayers/AudioPlayer.brs b/components/mediaPlayers/AudioPlayer.brs index 9e612373..bea4642b 100644 --- a/components/mediaPlayers/AudioPlayer.brs +++ b/components/mediaPlayers/AudioPlayer.brs @@ -1,6 +1,5 @@ sub init() m.playReported = false - m.top.disableScreenSaver = true m.top.observeField("state", "audioStateChanged") end sub @@ -10,6 +9,8 @@ sub audioStateChanged() reportedPlaybackState = "update" + m.top.disableScreenSaver = (currentState = "playing") + if currentState = "playing" and not m.playReported reportedPlaybackState = "start" m.playReported = true