Skip to content

Commit

Permalink
Remove "unobserve position" in JFVideo
Browse files Browse the repository at this point in the history
JFVideo now always observes position.  "Next Episode" button is displayed only if content type is "episode"
  • Loading branch information
jkim2492 committed Feb 3, 2023
1 parent 15a25b1 commit 3b7f7d7
Showing 1 changed file with 20 additions and 19 deletions.
39 changes: 20 additions & 19 deletions components/JFVideo.brs
Original file line number Diff line number Diff line change
Expand Up @@ -68,28 +68,26 @@ sub onContentChange()
m.top.observeField("position", "onPositionChanged")

' If video content type is not episode, remove position observer
if m.top.content.contenttype <> 4
m.top.unobserveField("position")
end if
' if m.top.content.contenttype <> 4
' m.top.unobserveField("position")
' end if
end sub

sub onNextEpisodeDataLoaded()
m.checkedForNextEpisode = true

m.top.observeField("position", "onPositionChanged")

if m.getNextEpisodeTask.nextEpisodeData.Items.count() <> 2
m.top.unobserveField("position")
end if
end sub

'
' Runs Next Episode button animation and sets focus to button
sub showNextEpisodeButton()
if not m.nextEpisodeButton.visible
m.showNextEpisodeButtonAnimation.control = "start"
m.nextEpisodeButton.setFocus(true)
m.nextEpisodeButton.visible = true
if m.top.content.contenttype = 4
if not m.nextEpisodeButton.visible
m.showNextEpisodeButtonAnimation.control = "start"
m.nextEpisodeButton.setFocus(true)
m.nextEpisodeButton.visible = true
end if
end if
end sub

Expand All @@ -109,15 +107,18 @@ end sub

' Checks if we need to display the Next Episode button
sub checkTimeToDisplayNextEpisode()
if int(m.top.position) >= (m.top.runTime - 30)
showNextEpisodeButton()
updateCount()
return
end if
if m.top.content.contenttype = 4

if m.nextEpisodeButton.visible or m.nextEpisodeButton.hasFocus()
m.nextEpisodeButton.visible = false
m.nextEpisodeButton.setFocus(false)
if int(m.top.position) >= (m.top.runTime - 30)
showNextEpisodeButton()
updateCount()
return
end if

if m.nextEpisodeButton.visible or m.nextEpisodeButton.hasFocus()
m.nextEpisodeButton.visible = false
m.nextEpisodeButton.setFocus(false)
end if
end if
end sub

Expand Down

0 comments on commit 3b7f7d7

Please sign in to comment.