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

Get all the audios (languages) availables in a .m3u8 and subtitles? #551

Closed
billyjoker opened this issue Jan 11, 2018 · 6 comments
Closed
Labels

Comments

@billyjoker
Copy link

Hi Brian, do you have any method to show all the available audio languages and subtitle texts in a .m3u8 file? I'd like to show a menu to the user which shows all the options available to select them.

Thanks!!

@brianwernick
Copy link
Owner

You should be able to call getAvailableTracks and grab the TrackGroupArray that's associated with RenderType.CLOSED_CAPTION. Then look at each of the TrackGroup's associated Format's to determine the metadata, etc. that you need.

@billyjoker
Copy link
Author

Yes, i could debug and call to getAvailableTracks, but the info returned it is not what i waited. I mean, with the subtitles i have no information about language (it is filled with a null), so reading i do not see hte language of the available subtitle track when i get:

getAvailableTracks().get(ExoMedia.RendererType.CLOSED_CAPTION).get(0).getFormat(0)

firstcaption

@brianwernick
Copy link
Owner

Does the track info available in the media actually contain the language information?

@billyjoker
Copy link
Author

Afirmative, this is the .m3u8 file:

.#EXTM3U
#EXT-X-VERSION:3
#EXT-X-STREAM-INF:BANDWIDTH=2298000,CODECS="avc1.100.40,mp4a.40.2",RESOLUTION=1920x1080,AUDIO="aac"
chunklist_b2298000_vo.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=1660000,CODECS="avc1.77.30,mp4a.40.2",RESOLUTION=1280x720,AUDIO="aac"
chunklist_b1660000_vo.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=894000,CODECS="avc1.77.30,mp4a.40.2",RESOLUTION=854x480,AUDIO="aac"
chunklist_b894000_vo.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=511000,CODECS="avc1.77.30,mp4a.40.2",RESOLUTION=640x360,AUDIO="aac"
chunklist_b511000_vo.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=383000,CODECS="avc1.77.30,mp4a.40.2",RESOLUTION=426x240,AUDIO="aac"
chunklist_b383000_vo.m3u8
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="aac",LANGUAGE="es",NAME="Spanish",DEFAULT=YES,URI="chunklist_b128000_ao_sles_t64U3BhbmlzaA==.m3u8"
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="aac",LANGUAGE="en",NAME="English",DEFAULT=YES,URI="chunklist_b128000_ao_slen_t64RW5nbGlzaA==.m3u8"
#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subt",LANGUAGE="es",NAME="Spanish",DEFAULT=YES,URI="../es_subt.vtt"

@brianwernick
Copy link
Owner

Is the offset correct (see #541) in to the available tracks mapping? Looking at the ExoPlayer code it seems that it should correctly be grabbing the language, etc.

@brianwernick
Copy link
Owner

I'm going to assume it's related to #451 and close the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants