HTML文件中加入此内容
1
2
3
4
5
6
7
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/frunoob/Library@master/blog/js/hls.css">
<video id="my_video_1" class="video-js vjs-default-skin" controls preload="auto" width="auto" height="auto"
data-setup='{}'>
<source src="请输入你的视频网址.m3u8" type="application/x-mpegURL">
</video>
<script src="https://cdn.jsdelivr.net/gh/frunoob/Library@master/blog/js/hls.js"></script>
<script src="https://cdn.jsdelivr.net/gh/frunoob/Library@master/blog/js/hls-videos.js"></script>