Prevent unneeded stop/start
This commit is contained in:
parent
e46f1097a3
commit
190f34edef
|
@ -99,6 +99,13 @@ sub processSubtitleSelection()
|
||||||
' The playbackData is now outdated and must be refreshed
|
' The playbackData is now outdated and must be refreshed
|
||||||
m.playbackData = invalid
|
m.playbackData = invalid
|
||||||
|
|
||||||
|
' Find previously selected subtitle and identify if it was encoded
|
||||||
|
for each item in m.view.fullSubtitleData
|
||||||
|
if item.index = m.view.selectedSubtitle
|
||||||
|
m.view.previousSubtitleWasEncoded = item.IsEncoded
|
||||||
|
end if
|
||||||
|
end for
|
||||||
|
|
||||||
if LCase(m.selectedSubtitle.track.description) = "none"
|
if LCase(m.selectedSubtitle.track.description) = "none"
|
||||||
m.view.globalCaptionMode = "Off"
|
m.view.globalCaptionMode = "Off"
|
||||||
m.view.subtitleTrack = ""
|
m.view.subtitleTrack = ""
|
||||||
|
|
|
@ -256,8 +256,17 @@ end sub
|
||||||
|
|
||||||
' Event handler for when selectedSubtitle changes
|
' Event handler for when selectedSubtitle changes
|
||||||
sub onSubtitleChange()
|
sub onSubtitleChange()
|
||||||
' If the global caption mode is on, that means Roku can display the subtitles natively and doesn't need a video stop/start
|
switchWithoutRefresh = true
|
||||||
if LCase(m.top.globalCaptionMode) = "on" then return
|
|
||||||
|
if m.top.SelectedSubtitle <> -1
|
||||||
|
' If the global caption mode is off, then Roku can't display the subtitles natively and needs a video stop/start
|
||||||
|
if LCase(m.top.globalCaptionMode) <> "on" then switchWithoutRefresh = false
|
||||||
|
end if
|
||||||
|
|
||||||
|
' If previous sustitle was encoded, then we need to a video stop/start to change subtitle content
|
||||||
|
if m.top.previousSubtitleWasEncoded then switchWithoutRefresh = false
|
||||||
|
|
||||||
|
if switchWithoutRefresh then return
|
||||||
|
|
||||||
' Save the current video position
|
' Save the current video position
|
||||||
m.global.queueManager.callFunc("setTopStartingPoint", int(m.top.position) * 10000000&)
|
m.global.queueManager.callFunc("setTopStartingPoint", int(m.top.position) * 10000000&)
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
<field id="PlaySessionId" type="string" />
|
<field id="PlaySessionId" type="string" />
|
||||||
<field id="Subtitles" type="array" />
|
<field id="Subtitles" type="array" />
|
||||||
<field id="SelectedSubtitle" type="integer" value="-2" alwaysNotify="true" />
|
<field id="SelectedSubtitle" type="integer" value="-2" alwaysNotify="true" />
|
||||||
|
<field id="previousSubtitleWasEncoded" type="boolean" />
|
||||||
<field id="container" type="string" />
|
<field id="container" type="string" />
|
||||||
<field id="directPlaySupported" type="boolean" />
|
<field id="directPlaySupported" type="boolean" />
|
||||||
<field id="systemOverlay" type="boolean" value="false" />
|
<field id="systemOverlay" type="boolean" value="false" />
|
||||||
|
|
Loading…
Reference in New Issue
Block a user