How to enable subtitles on dash stream?
See original GitHub issueExoPlayer 2.9.1 I run exoPlayer on AndroidTV with leanback support.
my configuration
ExoPlayerFactory.newSimpleInstance(
context,
DefaultRenderersFactory(context),
trackSelector,
DefaultLoadControl(),
defaultDrmSessionManager
)
and I switch tracks using below method:
fun setTrack(model: FormatUiModel) {
val newParams = trackSelector.buildUponParameters()
when (model.formatType) {
FormatUiModel.Type.VIDEO -> {
newParams.setMaxVideoBitrate(model.format.bitrate)
newParams.setMaxVideoSize(model.format.width, model.format.height)
}
FormatUiModel.Type.AUDIO -> {
newParams.setPreferredAudioLanguage(model.format.language)
}
FormatUiModel.Type.TEXT -> {
newParams.setRendererDisabled(C.TRACK_TYPE_VIDEO, false)
newParams.setPreferredTextLanguage(model.format.language)
}
}
trackSelector.parameters = newParams.build()
}
it works fine for video and audio. But subtitles/text are not displaying but I can see that text track is selected.
All available tracks:
com.tv.uat D/ExoPlayerAdapter: getFormatsFromTrackGroups 0, 0 Format(video=1001000, null, video/mp4, video/avc, avc1.640028, 1001000, null, [1024, 576, 25.0], [-1, -1])
com.tv.uat D/ExoPlayerAdapter: getFormatsFromTrackGroups 0, 1 Format(video=2001000, null, video/mp4, video/avc, avc1.640028, 2001000, null, [1280, 720, 25.0], [-1, -1])
com.tv.uat D/ExoPlayerAdapter: getFormatsFromTrackGroups 0, 2 Format(video=5001000, null, video/mp4, video/avc, avc1.640028, 5001000, null, [1920, 1080, 25.0], [-1, -1])
com.tv.uat D/ExoPlayerAdapter: getFormatsFromTrackGroups 0, 0 Format(audio_eng=128000, null, audio/mp4, audio/mp4a-latm, mp4a.40.2, 128000, en, [-1, -1, -1.0], [2, 48000])
com.tv.uat D/ExoPlayerAdapter: getFormatsFromTrackGroups 1, 0 Format(audio_lav=128000, null, audio/mp4, audio/mp4a-latm, mp4a.40.2, 128000, lv, [-1, -1, -1.0], [2, 48000])
com.tv.uat D/ExoPlayerAdapter: getFormatsFromTrackGroups 2, 0 Format(audio_lit=128000, null, audio/mp4, audio/mp4a-latm, mp4a.40.2, 128000, lt, [-1, -1, -1.0], [2, 48000])
com.tv.uat D/ExoPlayerAdapter: getFormatsFromTrackGroups 0, 0 Format(textstream_est=1000, null, application/mp4, application/ttml+xml, stpp, 1000, et, [-1, -1, -1.0], [-1, -1])
com.tv.uat D/ExoPlayerAdapter: getFormatsFromTrackGroups 1, 0 Format(textstream_lav=1000, null, application/mp4, application/ttml+xml, stpp, 1000, lv, [-1, -1, -1.0], [-1, -1])
com.tv.uat D/ExoPlayerAdapter: getFormatsFromTrackGroups 2, 0 Format(textstream_rus=1000, null, application/mp4, application/ttml+xml, stpp, 1000, ru, [-1, -1, -1.0], [-1, -1])
Can someone shows how to implement selecting text tracks? Or point me to right doc.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Subtitles - Unified Streaming
For DASH and Smooth output, by default the length of the subtitles segments is equal to the length of the fragments in the...
Read more >FOSDEM 2016 - Adding subtitles to the dash.js player
In this presentation, Solène Buet will detail how W3C TTML subtitles can be used with MPEG DASH streaming, and how it was tested...
Read more >Multiple Language Timed Text Sample - dash.js
Example showing content with multiple timed text tracks. The current texttrack settings can be saved in the local storage to be reused on...
Read more >HOW TO ADD SUBTITLES TO TWITCH STREAMS ... - YouTube
Today I show how to add closed captions & subtitles to your Twitch streams using a Twitch extension. Closed Captions Extension: ...
Read more >Dash manifest generation with subtitles - Stack Overflow
I believe it should be quite easy, simply putting subtitles' url somewhere with special tags. I've tried to find some information around about ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Are you using our
PlayerView
UI component?It takes care of rendering the subtitles if you’re using it. If you’re not using it then you need to add something as a text output to the player (
player.addTextOutput
), which will receive the subtitles. You’ll then need to render them. You can useSubtitleView
for this, if you don’t want to use the fullPlayerView. You can add a
SubtitleView` as a text output directly on the player.nop. I use leanback for android tv. Very similar as in this example: https://github.com/googlearchive/leanback-showcase
I will falow your advide. thx.