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: 
AlexB1lu
Reel Rookie

Setting subtitleConfig cause video suddenly stops

I've encountered a problem while playing videos. Whenever I switch the subtitles, the video suddenly stops. I'm using the following code to change the subtitle URL for m.videoPlayercontent.subtitleConfig = { trackName: captionURL }. Surprisingly, the logs show that the video is still in the playing state, and the URL seems to be correct.
I wanted  to see if anyone has experienced a similar issue or has any insights into what might be causing this problem. It's worth mentioning that the backend response's manifest </AdaptationSet> contains multiple subtitles, and I have attempted to use the subtitleTracks option in the API.
and I aslo tried using subtitleTrack, but the terminal displays an error stating that it is a nonexistent field (even though I have added this field in the VideoPlayerContentNode).
Your assistance or suggestions would be greatly appreciated. Thank you in advance for your help!

0 Kudos
3 REPLIES 3
renojim
Community Streaming Expert

Re: Setting subtitleConfig cause video suddenly stops

I don't think you can change that on the fly.  It's something you set up before starting the video.  If you have multiple subtitles you should be adding them to the SubtitleTracks property of the ContentNode's content metadata so the UI can handle them when the user presses *.

https://developer.roku.com/docs/developer-program/getting-started/architecture/content-metadata.md

Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
0 Kudos
AlexB1lu
Reel Rookie

Re: Setting subtitleConfig cause video suddenly stops

Since my closed caption and language are a custom UI, I have set up the SubtitleTracks before playing the startup video. However, regarding allowing users to change the subtitles during video playback. What code changes do I need to make in order to enable subtitle switching when the user clicks on it?

0 Kudos
renojim
Community Streaming Expert

Re: Setting subtitleConfig cause video suddenly stops

You shouldn't have to do anything.  The configured subtitle options should show up under "Captioning track" under "Accessibility & captions" when the user presses *.  I have to admit that I've only ever had one captioning track for my own videos, but that's how it's supposed to work.

Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
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.