Fix subtitle selection

Fixes #1607
This commit is contained in:
1hitsong 2023-12-31 16:12:54 -05:00
parent b9e55e0848
commit a37c7d9a7c
2 changed files with 8 additions and 4 deletions

View File

@ -111,19 +111,20 @@ sub processSubtitleSelection()
end if
if m.selectedSubtitle.IsEncoded
' Roku can not natively display these subtitles, so turn off the caption mode on the device
m.view.globalCaptionMode = "Off"
else
' Roku can natively display these subtitles, ensure the caption mode on the device is on
m.view.globalCaptionMode = "On"
end if
if m.selectedSubtitle.IsExternal
' Roku may rearrange subtitle tracks. Look up track based on name to ensure we get the correct index
availableSubtitleTrackIndex = availSubtitleTrackIdx(m.selectedSubtitle.Track.TrackName)
if availableSubtitleTrackIndex = -1 then return
m.view.subtitleTrack = m.view.availableSubtitleTracks[availableSubtitleTrackIndex].TrackName
else
m.view.selectedSubtitle = m.selectedSubtitle.Index
end if
m.view.selectedSubtitle = m.selectedSubtitle.Index
end sub
' User requested playback info

View File

@ -256,6 +256,9 @@ end sub
' Event handler for when selectedSubtitle changes
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
if LCase(m.top.globalCaptionMode) = "on" then return
' Save the current video position
m.global.queueManager.callFunc("setTopStartingPoint", int(m.top.position) * 10000000&)