cordova-plugin-exoplayer
cordova-plugin-exoplayer copied to clipboard
Switch Audio Track & Subtitles
Hi,
It would be nice to add feature to switch audio track. Some HLS streams embed alternate audio tracks.
Regards
Yes that would be nice. My streams are all single language so I didn't have the need for it so far.
There are two parts to this:
- Getting info about audio tracks and allowing an app to switch.
- Showing UI with all possible audio/video tracks.
No 1. is fairly easy, no 2. not so much. I'm hesitant to add more UI to the plugin and would rather it stay lean and just play streams.
I believe your ticket #26 is the step in the right direction where this plugin doesn't have any UI whatsoever.
I can provide you a stream with dual audio track. But I need your public IP address to allow access to our system. I believe that exoplayer has embedded feature to switch audio tracks.
May the following link give some point of start. https://medium.com/google-exoplayer/exoplayer-2-x-track-selection-2b62ff712cc9
I've found the following HLS stream thas have vairous audio and subtitles tracks http://sample.vodobox.com/planete_interdite/planete_interdite_alternate.m3u8
Finding these streams is not an issue, it's finding time to implement this.
ExoPlayer demo app has the functionality you're talking about, but this plugin is not a demo app. It doesn't use any of the demo app's UI. This is not a trivial feature, mainly because adding more Java based UI in a Cordova plugin is philosophically wrong thing to do. The right right approach would be to:
- Provide audio/video track information to Cordova through new API.
- Provide ability to select audio/video track programmatically from Cordova app.
- Allow Cordova app to overlay javascript based UI on top of ExoPlayer view so that list of tracks can be displayed.
You have two options if you really need this, either implement it yourself or pay someone else to implement it.
He thought he could have a custom button (similar to what he already has for play, next and prev) where he would call a callback and on him the developer could program this part.
This button would set in the init of the player. This would be great for me, if I had an API to show the subtitles or not
Finding these streams is not an issue, it's finding time to implement this.
ExoPlayer demo app has the functionality you're talking about, but this plugin is not a demo app. It doesn't use any of the demo app's UI. This is not a trivial feature, mainly because adding more Java based UI in a Cordova plugin is philosophically wrong thing to do. The right right approach would be to:
1. Provide audio/video track information to Cordova through new API. 2. Provide ability to select audio/video track programmatically from Cordova app. 3. Allow Cordova app to overlay javascript based UI on top of ExoPlayer view so that list of tracks can be displayed.
You have two options if you really need this, either implement it yourself or pay someone else to implement it.
We are ready to pay and sponsor the work. If you are available we can begin.
If anyone has time to work on this and submit a pull request that would be awesome, otherwise it's probably not gonna happen.