- 博客(0)
- 资源 (4)
- 收藏
- 关注
适合直播m3u8格式手机和PC端播放器
适合直播m3u8格式手机和PC端播放器,需要引入文件请下载,代码如下:
<link rel="stylesheet" href="DPlayer.min.css">
[removed][removed]
[removed][removed]
[removed]
const dp = new DPlayer({
container: document.getElementById('dplayer'),
live: true,
autoplay: true,
mutex: true,
video: {
url: 'https://cdn.letv-cdn.com/2018/12/05/JOCeEEUuoteFrjCg/playlist.m3u8',
type: 'customHls',
customType: {
'customHls': function (video, player) {
const hls = new Hls();
hls.loadSource(video.src);
hls.attachMedia(video);
}
}
}
});
[removed]
2019-05-18
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人