Video.js HTML5 player can play m3u8 playlist(HLS)?

kilg picture kilg · Feb 12, 2014 · Viewed 15.6k times · Source

How can I play HLS stream in HTML5 player Video.JS? I find examples, where is this type source:

<source src="http://server/hls/stream007.m3u8" type='video/mp4' />

<source src="http://server/hls/stream007.m3u8" type='application/vnd.apple.mpegurl' />

<source src="http://server/hls/stream007.m3u8" type='application/x-mpegURL' />

Can anybody help me?

Answer

heff picture heff · Feb 12, 2014

To use HLS on browsers that support it (Safari, iOS, some Androids) use the 'application/x-mpegURL'. You'll still need to provide an mp4 fallback for browsers that don't support HLS. Support for HLS in other browsers is currently in the works.