Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
Nethram
Level 7

Roku scene graph channel closed caption is not working .

I have closed caption in roku channel and it is not working after updating roku box firm wire to os 8.1 . It worked fine before updating firmwire .

m.videoPlayer.globalCaptionMode="On"
m.videoPlayer.subtitleTrack=ClosedCaptioningUrl


                Closed caption url is in ".vtt" format .
 1) Why closed caption is not working after updating  firmwire ? 
 2) Do I have to set any extra param  ?
0 Kudos
5 Replies
gomad
Level 7

Re: Roku scene graph channel closed caption is not working .

try setting the subtitle as mentioned in the below post, it may help:
https://forums.roku.com/viewtopic.php?f ... 15#p590015


regards,
GM
0 Kudos
Estebanicho
Level 7

Re: Roku scene graph channel closed caption is not working .

The exact same thing is happening to me. The code I used is the same as the one you've provided, and it worked with firmare 8.0. Unfortunately, I can't find any specific information about this specific firmware change, nor any concrete examples on the official Roku documentation.

Perhaps I've been doing things wrong all along, and it worked just out of coincidence, and with firmware 8.1 something might have been deprecated that finally broke my code. However, there's no error message or any kind of signal that may indicate what I am doing wrong.

I will try setting the subtitles URL on the ContentNode object, as suggested. However, in my Channel Application, the subtitles track URL may change at any time during playback. In such case, I don't know if a change in the ContentNode object will be detected or applied by the SceneGraph Video node once the playback of the video has started. Would that work?

If you find a solution, please share it. I will do so, too.
0 Kudos
Roku Employee
Roku Employee

Re: Roku scene graph channel closed caption is not working .

The big change in 8.1 was the addition of the user caption language preference.  This caused the media player to try to auto-select captions for the user's language from the set of caption tracks provided by the channel or streaming manifest.

Modifying Video.subtitleTrack internally modifies the current track on the content object associated with the video player.  It should be one of the values from the array of availableSubtitleTracks which is specified by setting the content metadata.  It also can be a eia608 or cea708 track name, as those don't have to be in the metadata.

So, preferred is to set content metadata's SubtitleTracks with the list of tracks, then use videoPlayer.subtitleTrack to pick the active track, overriding the automatic selection based on language.
0 Kudos
Estebanicho
Level 7

Re: Roku scene graph channel closed caption is not working .

Thanks for the reply, RokuBen.

I did change my code to set the subtitleTracks field on the ContentNode when starting playback of the video, and subtitles work this way. However, in my particular use case, I may not have the subtitles data available upon the start of playback. If I must use the subtitleTracks field on ContentNode, it implies that video playback must be restarted just to apply the new subtitle data on a fresh ContentNode object.

I tried updating the Video node's ContentNode during playback, either via direct assignment or setField(), but upon touching any ContentNode field the video playback halts and a "Retrieving..." message appears on a blank screen. I guess I am not supposed to modify the ContentNode once it is set on the Video node.

Any alternative you may suggest in order to be able to change subtitle data on the fly, as it becomes available, during video playback?
0 Kudos
Nethram
Level 7

Re: Roku scene graph channel closed caption is not working .

Thank you for the reply.
I have changed code and closed captioning is working perfectly now . 

videoContent.SubtitleTracks =[{"Language":"eng","TrackName":ClosedCaptioningUrl}]
0 Kudos