Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to switch between subtitles in my custom dialog i have used SingleSampleMediaSource #5143

Closed
Sathish-Kumar-Kanagaraj opened this issue Nov 26, 2018 · 1 comment
Assignees
Labels

Comments

@Sathish-Kumar-Kanagaraj
Copy link

Sathish-Kumar-Kanagaraj commented Nov 26, 2018

I want to switch between subtitles in my custom dialog ,I have parsed single subtitle file using SingleSampleMediaSource but while switching between different subtitles how to handle it without restarting the video, where can i see the piece of code in demo app

@Sathish-Kumar-Kanagaraj Sathish-Kumar-Kanagaraj changed the title I want to switch between subtitles in my custom dialog ,I have parsed single subtitle file using I want to switch between subtitles in my custom dialog ,I have parsed single subtitle file using SingleSampleMediaSource but while switching between different subtitles how to handle it without restarting the video, where can i see the piece of code in demo app Nov 26, 2018
@Sathish-Kumar-Kanagaraj Sathish-Kumar-Kanagaraj changed the title I want to switch between subtitles in my custom dialog ,I have parsed single subtitle file using SingleSampleMediaSource but while switching between different subtitles how to handle it without restarting the video, where can i see the piece of code in demo app switch between subtitles in my custom dialog Nov 26, 2018
@Sathish-Kumar-Kanagaraj Sathish-Kumar-Kanagaraj changed the title switch between subtitles in my custom dialog How to switch between subtitles in my custom dialog i have used SingleSampleMediaSource Nov 26, 2018
@ojw28 ojw28 self-assigned this Nov 27, 2018
@ojw28 ojw28 added the question label Nov 27, 2018
@ojw28
Copy link
Contributor

ojw28 commented Nov 27, 2018

You can add any number of subtitle SingleSampleMediaSources to the MergingMediaSource that you pass to the player. So if you know where the subtitles are in advance, set them all up before starting playback, and pass them all into the MergingMediaSource. This will cause the player to list each one as an available track. This will cause a corresponding track for each of them to become available (e.g. you'll be able to select between them in the demo app). Setting up in this way is very cheap; we don't load the data or parse the subtitle data unless the track is actually selected.

If you don't know the location of the subtitles in advance, and want to add a location mid playback, then that's unfortunately not supported currently. Supporting this is tracked by #1649.

@ojw28 ojw28 closed this as completed Nov 27, 2018
@google google locked and limited conversation to collaborators May 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants