Replace global caption with JF video caption

This commit is contained in:
Jinho Kim 2023-01-26 19:12:52 -05:00
parent 2fc121fc50
commit 0bee595dc3

View File

@ -76,7 +76,8 @@ end function
function setupSubtitle(video, subtitles, subtitle_idx = -1) as integer function setupSubtitle(video, subtitles, subtitle_idx = -1) as integer
if subtitle_idx = -1 if subtitle_idx = -1
' If we are not using text-based subtitles, turn them off ' If we are not using text-based subtitles, turn them off
video.globalCaptionMode = "Off" ' Turn captions on by default
video.captionVisible = True
return -1 return -1
end if end if
@ -87,10 +88,11 @@ function setupSubtitle(video, subtitles, subtitle_idx = -1) as integer
if selectedSubtitle.IsEncoded if selectedSubtitle.IsEncoded
' With encoded subtitles, turn off captions ' With encoded subtitles, turn off captions
video.globalCaptionMode = "Off" video.captionVisible = False
else else
' If this is a text-based subtitle, set relevant settings for roku captions ' If this is a text-based subtitle, set relevant settings for roku captions
video.globalCaptionMode = "On" video.captionVisible = True
video.subtitleTrack = video.availableSubtitleTracks[availSubtitleTrackIdx(video, subtitleSelIdx)].TrackName video.subtitleTrack = video.availableSubtitleTracks[availSubtitleTrackIdx(video, subtitleSelIdx)].TrackName
end if end if
@ -165,8 +167,9 @@ sub changeSubtitleDuringPlayback(newid)
video.control = "play" video.control = "play"
else else
' Switching from text to text (or none to text) does not require stopping playback ' Switching from text to text (or none to text) does not require stopping playback
video.globalCaptionMode = "On"
video.subtitleTrack = video.availableSubtitleTracks[availSubtitleTrackIdx(video, newid)].TrackName video.subtitleTrack = video.availableSubtitleTracks[availSubtitleTrackIdx(video, newid)].TrackName
video.captionVisible = True
end if end if
video.SelectedSubtitle = newid video.SelectedSubtitle = newid
@ -177,7 +180,7 @@ sub turnoffSubtitles()
video = m.scene.focusedChild.focusedChild video = m.scene.focusedChild.focusedChild
current = video.SelectedSubtitle current = video.SelectedSubtitle
video.SelectedSubtitle = -1 video.SelectedSubtitle = -1
video.globalCaptionMode = "Off" video.captionVisible = False
m.device.EnableAppFocusEvent(false) m.device.EnableAppFocusEvent(false)
' Check if Enoded subtitles are being displayed, and turn off ' Check if Enoded subtitles are being displayed, and turn off
if current > -1 and video.Subtitles[current].IsEncoded if current > -1 and video.Subtitles[current].IsEncoded