网页前端(Html)video播放m3u8(HLS)&Vue使用video.js播放m3u8


网页前端(Html)video播放m3u8(HLS)
HLS (HTTP Live Streaming)是Apple公司研发的流媒体传输技术,包括一个m3u8的索引文件、多个ts分片文件和key加密串文件。这项技术主要应用于点播和直播领域。

开源JS库(Github):

【video.js】https://github.com/videojs/videojs-contrib-hls
【hls.js】https://github.com/video-dev/hls.js/

腾讯视频SDK(TCPlayerLite),文档地址:https://cloud.tencent.com/document/product/881/20207




8 />
videojs-contrib-hls embed

  "https://unpkg.com/video.js/dist/video-js.css" rel="stylesheet">
  
  
  


  

Video.js Example Embed

注:可以指定多个source标签。


"zh-CN">

    "UTF-8">
    前端播放m3u8格式视频
    "https://vjs.zencdn.net/7.4.1/video-js.css" rel="stylesheet">
    
    
    


    
    
class="qiehuan" style="width:100px;height: 100px;background: red;margin:0 auto;line-height: 100px;color:#fff;text-align: center">切换视频