Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android HLS video mime type

I would like to fire an Intent to play a HLS (HTTP Live Stream) video.

What should I put in the type field to fire just the video players that support HLS?

I tried unsuccessfully the following:

video/m3u

video/m3u8

video/hls

application/x-mpegURL

vnd.apple.mpegURL

video/MP2T

application/vnd.apple.mpegurl

Ideas please...

like image 761
AlikElzin-kilaka Avatar asked Feb 07 '12 14:02

AlikElzin-kilaka


3 Answers

You should put the Content-Type type specified in the RFC: application/vnd.apple.mpegurl. See section 3.1 of https://datatracker.ietf.org/doc/html/draft-pantos-http-live-streaming-08

Android support for HLS is extremely poor. You will need some third party software on many devices, especially for versions less than 3. Google doesn't seem to care, or at least not to regression test.

like image 133
vipw Avatar answered Nov 10 '22 09:11

vipw


Android code (ICS, JB) looks at the URL to determine player selection! If the URL contains the keyword m3u8, then and only then, will it play HLS. This is obviously a bug in Android.

like image 25
thoma.ing Avatar answered Nov 10 '22 09:11

thoma.ing


Having the same issue but "audio/x-mpegURL" seems to work as is what the sample HLS stream on Apples site uses http://devimages.apple.com/iphone/samples/bipbop/gear1/prog_index.m3u8 - testing on a Galaxy Nexus BTW.

Bit confusing though hence why I'm looking around.

like image 1
Janaka Avatar answered Nov 10 '22 09:11

Janaka