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
Support download bundles #5615
Comments
I'd suggest downloading them independently, using ProgressiveDownloader for the subtitle file, and HlsDownloader for the HLS stream. Then locally, use a merging media source, as per usual. I cannot think of a proper way of treating SRT subtitles as part of an HLS media source. It's worth mentioning that SRT subtitles are not supported by the HLS specification. I'll assign @erdemguven in case anything I said doesn't make sense. Hope this answers your question. |
Thanks for looking into this.
This is something I hope I could avoid - this will create 2 download tasks for the same download content and it will be confusing for the end user.
Yes, but is there a way maybe to treat SRT subtitles as something else - can I put some tags and/or settings to Segment object that I create manually, so that Exoplayer creates a simple sample source out of provided url and merges it in automatically? |
Perhaps you can hide srt downloads from user. Or you can just directly download srt file using CacheUtil.cache method without using DownloadManager.
Merge SRT to HLS playlist? Exoplayer don't support rewriting playlist so even if you change the in memory state of it, it won't be persisted. Also as @AquilesCanta pointed HLS doesn't support SRT. The ideal solution would be adding support for download bundles so I will change this to a feature request but I can't promise it will be implemented. |
[REQUIRED] Searched documentation and issues
Searched for info:
[REQUIRED] Question
This is a hacky question, but is there a way to add SRT file as subtitles track in ManifestParser? (without using MergeSource)
I have HLS content + subtitles for it stored as a separate SRT file on the server. I would like to download HLS content with subtitles using download service as desribed here:
https://medium.com/google-exoplayer/downloading-streams-6d259eec7f95
General download works fine, but I cannot tell DownloadService to download SRT file because it is not a track (can't create StreamKey for it) until I merge it in using MergedMediaSource.
As a workaround I created a custom ManifestParser and custom HlsDownloadAction and HlsDownloader classes using custom ManifestParser. (This part works - I can download HLS successfully).
Then in manifest parser I try to create subtitles track artificially with:
This creates the track, but it does not work, because it expects url of the manifest and I provide url for SRT file. I have tried to intercept the request for this url and provide a "hand made" HlsPlaylist:
But this also fails (it hangs forever on buffering when I try to enable this track with selection override).
I'm quite sure that there is a way to add SRT file as a track, but got somewhat lost in codes.
Could you give me some clues how to get there?
The text was updated successfully, but these errors were encountered: