About H5 play HTTP Live streaming m3u8 format video

Source: Internet
Author: User
Tags microsoft edge

Hls,http live Streaming is an apple-defined protocol for real-time streaming, and HLS is based on the Http protocol, which mainly consists of two parts: the m3u8 profile and the TS media file.

Because it is apple out of the video playback format, so the PC side in addition to safari other browsers basically do not support, Microsoft Edge launch on the support, is the specific support of each browser

Can see Android and iOS basically can think of all support, I use the hls.js to play

Item Https://github.com/video-dev/hls.js

The use of the way is also very simple, directly look at his example of the line, the main is to pass in the m3u8 description file, and then load TS file slice playback, the background TS file path to correct

<script src= "Https://cdn.jsdelivr.net/npm/[email protected]" ></script><video id= "video" ></ Video><script>  if (hls.issupported ()) {    var video = document.getElementById (' video ');    var HLS = new HLs ();    Hls.loadsource (' https://video-dev.github.io/streams/x36xhzz/x36xhzz.m3u8 ');    Hls.attachmedia (video);    Hls.on (Hls.events.manifest_parsed,function () {      video.play ();  }); </script>

About H5 play HTTP Live streaming m3u8 format video

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.