amzn / exoplayer-amazon-port

Official port of ExoPlayer for Amazon devices
Apache License 2.0
173 stars 80 forks source link

APPLICATION_M3U8 Subtitles are not supported #51

Closed srikanthsunkari closed 6 years ago

srikanthsunkari commented 6 years ago

Hi, I am facing a problem with m3u8 links for displaying subtitles, seems m3u8 links are not supported in this library, It works fine with exoplayer library. Trying to construct the media source like:


Format englishSubsFormat = Format.createTextSampleFormat(null, MimeTypes.APPLICATION_M3U8, null, Format.NO_VALUE, Format.NO_VALUE, "eng", null);
            Format thaiSubsFormat = Format.createTextSampleFormat(null, MimeTypes.APPLICATION_M3U8, null, Format.NO_VALUE, Format.NO_VALUE, "thai", null);
            MediaSource englishSubsSource = new SingleSampleMediaSource(Uri.parse(englishUrl), mediaDataSourceFactory, englishSubsFormat, C.TIME_UNSET);
            MediaSource thaiSubsSource = new SingleSampleMediaSource(Uri.parse(thaiUrl), mediaDataSourceFactory, thaiSubsFormat, C.TIME_UNSET);
            MergingMediaSource mergedSource = new MergingMediaSource(videoSource, englishSubsSource, thaiSubsSource);

EventLogger shows below logs,

Renderer:None [ 08-27 15:35:51.903 27269-27269/com.myplex.vodafonestaging D/EventLogger: Group:0 [ [ ] Track:0, id=null, mimeType=application/x-mpegURL, language=English, supported=NO ]

Please help here.

peddisri commented 6 years ago

Can you share the URL?

srikanthsunkari commented 6 years ago

sure, can you share your email id, so that I can share it to your email?

srikanthsunkari commented 6 years ago

please try this link http://myplexv2stagingimages.s3-ap-southeast-1.amazonaws.com/test/BarbieDreamtopia-cap_eng.m3u8

peddisri commented 6 years ago

ok thanks.

srikanthsunkari commented 6 years ago

Hi Srikanth, Shared an original m3u8 link to your email.

peddisri commented 6 years ago

I'm able to use the URL you gave in Exo Demo app and play them fine. By default the subtitle is disabled. I had to go to the Text Menu option and select "unknown" as the subtitle and it starts rendering. Our port does not do anything to impact subtitles.

srikanthsunkari commented 6 years ago

Hi @peddisri, I've figured out that using SingleSampleMediaSource it is not possible to play hls subtitle source. By changing SingleSampleMediaSource to HlsMediaSource worked fine for me too, this is the original problem with sample source initialization. -Thanks.