子沫
免费p2p加速播放器m3u8播放器开源免费
11/22
本文最后更新于2019年11月22日,已超过1825天没有更新。如果文章内容或图片资源失效,请留言反馈,我会及时处理,谢谢!
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>DPlayer with hls.js engine and P2P demo</title>
<script src="../node_modules/p2p-media-loader-core/build/p2p-media-loader-core.js"></script>
<script src="../build/p2p-media-loader-hlsjs.js"></script>
<script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/p2p-dplayer@latest/dist/DPlayer.min.css">
<script src="https://cdn.jsdelivr.net/npm/dplayer@latest"></script>
<style>
#dplayer {
width: 720px;
margin-left: auto;
margin-right: auto;
display: block;
}
</style>
</head>
<body>
<div id="dplayer"></div>
<script>
if (Hls.isSupported() && p2pml.hlsjs.Engine.isSupported()) {
window.dp = new DPlayer({
container: document.getElementById("dplayer"),
video: {
url: "https://akamai-axtest.akamaized.net/routes/lapd-v1-acceptance/www_c4/Manifest.m3u8",
type: "customHls",
customType: {
"customHls": function (video, player) {
const engine = new p2pml.hlsjs.Engine();
const hls = new Hls({
liveSyncDurationCount: 7, // To have at least 7 segments in queue
loader: engine.createLoaderClass()
});
p2pml.hlsjs.initHlsJsPlayer(hls);
hls.loadSource(video.src);
hls.attachMedia(video);
}
}
}
});
} else {
document.write("Not supported :(");
}
</script>
</body>
</html>
版权属于:
Strjson博客-专注于各种精品源码、精品软件、技术教程分享、黑客技术、破解教程(爱你在心口难开、没事写一写)
本文链接:
https://jpgke.com/jishu/135.html(转载时请注明本文出处及文章链接)
作品采用:
wwwwww五万
www
该喝喝