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...
You should put the Content-Type type specified in the RFC: application/vnd.apple.mpegurl. See section 3.1 of http://tools.ietf.org/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.
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.
The problem
When I used
it failed with
videoElement.error == error.MEDIA_ERR_SRC_NOT_SUPPORTED
[1] on Chrome 40, even though Chrome requested thesrc
URL three times as seen in tcpdump. This is the response from the server:Footnotes
MEDIA_ERR_SRC_NOT_SUPPORTED
has a value of4
.The solution
It seems like thoma.ing's answer is correct for Chrome 40 on Android 4.4.4 at least:
When I changed the video
src
URL to include them3u8
keyword it started working perfectly fine on Chrome.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.