P2P播放器CBPlayer源码文件

简介

本源码是以hls.js作为播放内核的,所以可以集成到内置hls.js的任何H5视频播放器中!以下为部分播放器集成示例,当然您也可以尝试集成到其他播放器中。
#CBPlayer

CBPlayer介绍

本示例为php版本,可以直接调用,调用方式:http://example.com?url=


<html>
<head>
<title>dplayer增加记忆+P2P播放</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11" />
<meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" id="viewport" name="viewport">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/cbplayer@latest/dist/CBPlayer.min.css" />
<style type="text/css">
body,html{width:100%;height:100%;background:#000;padding:0;margin:0;overflow-x:hidden;overflow-y:hidden}
*{margin:0;border:0;padding:0;text-decoration:none}
#video{position:inherit}
</style>
</head>
<body style="background:#000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" oncontextmenu=window.event.returnValue=false>
<div id="video"></div>
<script src="https://cdn.jsdelivr.net/npm/cdnbye@latest/dist/hlsjs-p2p-engine.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/hls.js@0.14.0"></script>
<script src="https://cdn.jsdelivr.net/npm/cbplayer2@latest"></script>
<script>
var url = '<?php echo($_REQUEST['url']);?>';
var dp = new CBPlayer({
container: document.getElementById('video'),
autoplay: true,
hotkey: true, // 移动端全屏时向右划动快进,向左划动快退。
video: {
url:url,
// pic: 'loading_wap.gif',
},
});
dp.on('fullscreen', function () {
if (/Android|webOS|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
screen.orientation.lock('landscape');
}
});
</script>
</body>
</html>
晚高峰稳定 4K 的 IPLC 机场 解锁各流媒体 支持月付
© 版权声明
THE END
喜欢就支持以下吧
点赞0赞赏 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容