Toggle disableScreenSaver based on audio state

Fixes #1230
This commit is contained in:
1hitsong 2023-04-26 17:37:15 -04:00
parent 386400d577
commit 63e1d97536

View File

@ -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