Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix forced subs keep Roku subs set to "On Always" #2020

Open
wants to merge 1 commit into
base: 2.2.z
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion components/video/VideoPlayerView.bs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ sub init()
m.top.getScene().findNode("overhang").visible = false
userSettings = m.global.session.user.settings
m.currentItem = m.global.queueManager.callFunc("getCurrentItem")
m.originalClosedCaptionState = invalid

m.top.id = m.currentItem.id
m.top.seekMode = "accurate"
Expand Down Expand Up @@ -461,7 +462,12 @@ sub onVideoContentLoaded()
availableSubtitleTrackIndex = availSubtitleTrackIdx(selectedSubtitle.Track.TrackName)
if availableSubtitleTrackIndex <> -1
if not selectedSubtitle.IsEncoded
m.top.globalCaptionMode = "On"
if selectedSubtitle.IsForced
' If IsForced, make sure to remember the Roku global setting so we
' can set it back when the video is done playing.
m.originalClosedCaptionState = m.top.globalCaptionMode
m.top.globalCaptionMode = "On"
end if
m.top.subtitleTrack = m.top.availableSubtitleTracks[availableSubtitleTrackIndex].TrackName
end if
end if
Expand Down Expand Up @@ -697,6 +703,12 @@ sub ReportPlayback(state = "update" as string)
m.bufferCheckTimer.duration = 30
end if

if (state = "stop" or state = "finished") and m.originalClosedCaptionState <> invalid
m.log.debug("ReportPlayback() setting", m.top.globalCaptionMode, "back to", m.originalClosedCaptionState)
m.top.globalCaptionMode = m.originalClosedCaptionState
m.originalClosedCaptionState = invalid
end if

' Report playstate via worker task
playstateTask = m.global.playstateTask
playstateTask.setFields({ status: state, params: params })
Expand Down
Loading