Only check contenttype once on content change

This commit is contained in:
1hitsong 2022-11-17 21:05:32 -05:00
parent 0ce5d2fd67
commit beab170142

View File

@ -2,7 +2,8 @@ sub init()
m.playbackTimer = m.top.findNode("playbackTimer")
m.bufferCheckTimer = m.top.findNode("bufferCheckTimer")
m.top.observeField("state", "onState")
m.top.observeField("position", "onPositionChanged")
m.top.observeField("content", "onContentChange")
m.playbackTimer.observeField("fire", "ReportPlayback")
m.bufferPercentage = 0 ' Track whether content is being loaded
m.playReported = false
@ -24,6 +25,14 @@ sub init()
m.moveDownnextEpisodeButtonAnimation = m.top.findNode("moveDownnextEpisodeButton")
end sub
sub onContentChange()
m.top.observeField("position", "onPositionChanged")
if m.top.content.contenttype <> 4
m.top.unobserveField("position")
end if
end sub
'
' Runs Next Episode button animation and sets focus to button
sub shownextEpisode()
@ -62,11 +71,9 @@ end sub
' When Video Player state changes
sub onPositionChanged()
' Check if content is episode
' Check if dialog is open
m.dialog = m.top.getScene().findNode("dialogBackground")
if m.top.content.contenttype = 4 and isValid(m.dialog)
'do nothing until dialog is closed
else if m.top.content.contenttype = 4
if not isValid(m.dialog)
handleNextEpisode()
end if
end sub