-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
add exoplayer subtitles attributte #972
Conversation
How to use it, please |
Just add a boolean to the subtitle prop. |
Hello, your example is HLS embedded subtitles, can you do plug-in subtitles, such as VTT, ass file type subtitles? |
My needs are similar to him |
No unfortunately this PR is specifically only for subtitles attached directly to the HLS stream. |
I need support for external subtitles as well and should be able to put together a PR for ExoPlayer support shortly. It would make a lot of sense to have a unified API to control both embedded & external subtitles. Trying to stay close to the HTML5 video tag (https://developer.mozilla.org/en-US/Apps/Fundamentals/Audio_and_video_delivery/Adding_captions_and_subtitles_to_HTML5_video), I came up with:
I think we want to be able to switch between tracks without reloading the video or loading subtitles on the fly, so this approach would make it easier. Looping in a team member @akshaygore06 for thoughts. |
@cobarx: I like your approach of passing the list of available tracks with the video source. I think this will be a good approach to solve the subtitles sideloading issue. |
I have added basic support for subtitles in an HLS stream using iOS' AVPlayer flextv@ce01d5a I think it might be a good idea to work together on establishing an API, both for vtt subtitles included in an HLS stream, and side-loaded from external files (although Apple is quite sparse on how to work with external subtitles, there are some ways to do it). @sungjkim34 For HLS subtitles, there seems to be an option to set a preferred language for the subtitles. Do you think we should add it as an option? @cobarx Are you working off https://google.github.io/ExoPlayer/guide.html#side-loading-a-subtitle-file? Are there any other configuration options that might be included? |
@petrbela Not seeing anything else we need to support at the moment, we can always add more attributes later. Does anyone know how to control the order that the props are passed to the native module? ExoPlayer only supports loading subtitles before the video starts and React Native is passing the source prop before the track prop. |
I have a pretty clear idea of what's required to implement robust text track support for both iOS & ExoPlayer. I've documented my ideas in #1044, please provide feedback. I should have be able to get embedded caption support done in about a week. |
My implementation is now ready in #1049. |
Going to close this since we have a more robust implementation in the other PR. I'll open another PR in the next few weeks to support sidecar subtitles. |
When using the exoplayer, the
subtitle
boolean attribute will now toggle on or off the subtitles.This works especially great with a HLS with embedded subtitles.