mirror of
https://github.com/jellyfin/jellyfin-roku.git
synced 2024-11-23 14:19:40 +00:00
Only check contenttype once on content change
This commit is contained in:
parent
0ce5d2fd67
commit
beab170142
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user