video.js解析m3u8在线播放

2020-05-09 15:55:39 浏览数 (1)

流媒体服务器: wowza

流媒体格式: m3u8

播放端:移动端网页(Android、IOS)

播放工具: video.js

代码如下:

代码语言:javascript复制
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>videojs-contrib-hls embed</title>
  

  <link href="https://unpkg.com/video.js/dist/video-js.css" rel="stylesheet">
  <script src="https://unpkg.com/video.js/dist/video.js"></script>
  <script src="https://unpkg.com/videojs-contrib-hls/dist/videojs-contrib-hls.js"></script>
  
</head>
<body>
  <h1>Video.js Example Embed</h1>

  <video id="my_video_1" class="video-js vjs-default-skin" controls preload="auto" width="100%" height="auto" 
  data-setup='{}'>
    <source src="http://live.xxx.cn:1935/live/8C23D96A479B9C4BE055000000000107-EXT/playlist.m3u8" type="application/x-mpegURL">
  </video>
  
  <script>
  </script>
  
</body>
</html>

0 人点赞