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

Demo app: Allow specifying separate subtitle file (e.g. in exolist.json files) #5523

Closed
efkann opened this issue Feb 17, 2019 · 2 comments
Closed

Comments

@efkann
Copy link

efkann commented Feb 17, 2019

Hi,I'm trying to test my streams using the demo application and the guide which you can reach through this link
https://google.github.io/ExoPlayer/demo-application.html

As you can see and as you know it gets the streams from a local json file named "media.exolist.json".Everything is good about streams and works perfectly fine,but I also want to get subtitle URL from that json file and merge that subtitle to related stream.For example,it will be something like this

{
"name": "My Test Stream",
"uri": "https://testtest.mpd",
"drm_scheme": "widevine",
"drm_license_url": "https://testtest.com"
"subtitle":" "http://subtitledomain.com/test.vtt"
},

So,how can I do it by changing demo codes ? If you can help me about this I'd be more than happy.

@marcbaechinger
Copy link
Contributor

marcbaechinger commented Feb 17, 2019

You can sideload text tracks with a MergingMediaSource. The developer guide has a section about sideloading text tracks which describes how you can achieve this.

You are right that there is no such example in the demo app. If you want to adapt this for your app you need to add the property to one of the subclasses of SampleChooserActivity.Sample and include the subtitle property in the intent extras like the other properties. The intent needs then to be consumed in the PlayerActivity where you can read the subtitle property out of the extras of the intent and create a merging data source with it.

@efkann
Copy link
Author

efkann commented Feb 18, 2019

Thank you for your answer,it would've been amazing if you had an option like this in demo app.

@ojw28 ojw28 changed the title Question about loading subtitles from local json Demo app: Allow specifying separate subtitle file (e.g. in exolist.json files) Mar 6, 2019
@icbaker icbaker assigned icbaker and unassigned marcbaechinger Oct 31, 2019
ojw28 pushed a commit that referenced this issue Nov 5, 2019
issue:#5523
PiperOrigin-RevId: 277927555
@ojw28 ojw28 closed this as completed Nov 5, 2019
@icbaker icbaker reopened this Dec 3, 2019
@icbaker icbaker closed this as completed Dec 3, 2019
@google google locked and limited conversation to collaborators Feb 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants