Play hls segmented stream with m3u8 playlist

Can the mediaelement player play the mpegts hls segmented stream defined in the m3u8 playlist, and if you could show the code for this. In my case, there is a test list test.m3u8 on the web server:

#EXTM3U #EXT-X-TARGETDURATION:10 #EXT-X-MEDIA-SEQUENCE:7291 #EXTINF:12, test-7291.ts #EXTINF:12, test-7292.ts #EXTINF:12, test-7293.ts #EXTINF:12, test-7294.ts #EXTINF:12, test-7295.ts #EXTINF:12, test-7296.ts #EXTINF:12, test-7297.ts #EXTINF:12, test-7298.ts #EXTINF:12, test-7299.ts #EXTINF:12, test-7300.ts 

iOS devices can view live streams without problems.

+3
source share
2 answers

Yes it is possible. Put src in .m3u8 in your video tag: <video src="/link/to/your_file.m3u8" />

and init plugin:

var video = document.getElementsByTagName('video')[0];

var player = new MediaElement(video);

The player will start playing from the first item in the .m3u8 list. In addition, the ability to play m3u8 lists is not a virtue of mediaelement.js, its platform feature

+1
source

You need to make some changes to the library. You can check my changes. Just adding m3u8 to the supported formats, it works great. https://github.com/sourcebits-harshitakasera/mediaelement-and-player-v2 This seems to work for me.

+1
source

All Articles