Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Anonymous
Not applicable

Subtitles are out of sync after track change

Hello everyone! I am working on my channel with custom videoplayer (video node is a child of my ui screen). And I am constantly facing a problem with subtitles. I have an hls format stream and when I enable imbedded subtitle tracks (setting subtitleTrack field of Video node and globalCaptionMode to "On") - everything works fine. But sometimes when I try to change subtitleTrack to select other language, it causes player to buffer and after buffering is done subtitles start displaying from the very beginnig while video playback continues. This causes subtitles being out of sync after changing language. I've tried disabling globalCaptionMode before chaning track and then enabling it back, but it didn't work out. Any ideas will be highly appreciated as work on this problem for two weeks already and can't find the way out.

Here is the part of code i am using to select subtitles

 

sub setSubtitles()
    if m.SelectedSubtitles = "Off" 
        m.player.globalCaptionMode = "Off"
        return
    end if
    for each language in m.player.availableSubtitleTracks
        if UCase(language.language) = Ucase(m.SelectedSubtitles)
            m.player.subtitleTrack = language.TrackName
            if m.player.globalCaptionMode <> "On"
                m.player.globalCaptionMode = "On"
                exit for
            end if
        end if
    end for
end sub

 

0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.