gooky
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2016
02:58 PM
How to change subtitles during playback
Hi,
I want the user to be able to choose between different subtitles, I use the code below. However any changes are not applied to the movie.
What am i doing wrong?
I want the user to be able to choose between different subtitles, I use the code below. However any changes are not applied to the movie.
What am i doing wrong?
sub init()
movieNode = CreateObject("roSGNode", "ContentNode")
movieNode.Title = "Movie name"
movieNode.StreamFormat = "mp4"
movieNode.URL = "http://187.188.137.31/test.m4v"
movieNode.SubtitleTracks = [{ TrackName: "http://187.188.137.31/latin.srt", Language:"spa", Description:"Spanish" }, { TrackName: "http://187.188.137.31/english.srt", Language:"eng", Description:"English" }]
m.player = m.top.findNode("player")
m.player.content = movieNode
m.player.control = "play"
m.player.setFocus(true)
end sub
5 REPLIES 5
adrianc1982
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2016
06:39 PM
Re: How to change subtitles during playback
im still coding my app in scene graph so i havent gotten to video playback as im building my menus en ui
but according to what i read from the docs you should call m.player.globalCaptionMode("On"). By default captions is "Off"
you can learn more at
https://sdkdocs.roku.com/display/sdkdoc/Video#Video-Fields
but according to what i read from the docs you should call m.player.globalCaptionMode("On"). By default captions is "Off"
Subtitles may or may not be visible on the screen, depending upon the user's caption setting. Reading this field will return the identifier of the current subtitle track, and setting the field will change the track.
you can learn more at
https://sdkdocs.roku.com/display/sdkdoc/Video#Video-Fields
gooky
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2016
07:56 AM
Re: How to change subtitles during playback
You are correct, one needs to make sure that it is on, however in my sandbox the captions are on by default, so this is not the problem right now 🙂
Did I forget to mention... if I write the following:
the movie starts with latin subtitles. However, changing the subtitle to English in closed caption dialog, it continues to show latin and not English as expected.
It seems like a bug, because I can observe the field subtitleTrack on the player and it actually changes when changing subtitles in closed caption dialog. However no request is made to the server, thus no change of subtitle 😞
Did I forget to mention... if I write the following:
movieNode.SubtitleConfig = { TrackName: "http://187.188.137.31/latin.srt" }
the movie starts with latin subtitles. However, changing the subtitle to English in closed caption dialog, it continues to show latin and not English as expected.
It seems like a bug, because I can observe the field subtitleTrack on the player and it actually changes when changing subtitles in closed caption dialog. However no request is made to the server, thus no change of subtitle 😞
adrianc1982
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2016
04:25 PM
Re: How to change subtitles during playback
you could try to disable close caption setting the english subs and then enabling captions.
tifroz
Streaming Star
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2019
02:11 PM
Re: How to change subtitles during playback
Did you ever figure it out? Would appreciate the solution as I am experiencing the same behavior!
gomad
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2019
03:19 AM
Re: How to change subtitles during playback
what stream are u using? the above code works with HLS streams for me, DASH we are also having issues with the same code, same behaviour.
So according to their documentation:
In the 8.0 firmware, automatic track selection based on a preferred caption language setting is intr...
so u dont have to set the configSubtitle but just the SubtitleTracks with an AA.
So according to their documentation:
In the 8.0 firmware, automatic track selection based on a preferred caption language setting is intr...
so u dont have to set the configSubtitle but just the SubtitleTracks with an AA.