苹果CMSV10集成CKplayer播放器+P2P播放,
在网站根目录上传或创建ck.php,代码如下
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" /> <title>m3u8</title> <style type="text/css">body,html,.a1{background-color:#000;padding: 0;margin: 0;width:100%;height:100%;} #info{position:fixed;top:5px;left:10px;font-size:10px;color:#fdfdfd;z-index:20719029;text-shadow:1px 1px 1px #000, 1px 1px 1px #000}</style> </head> <body ondragstart="window.event.returnValue=false" oncontextmenu="window.event.returnValue=false" onselectstart="event.returnValue=false" style="overflow-y:hidden;"> <div id="video" style="width:100%;height:100%;"></div> <p id="info"></p> <script type="text/javascript" src="http://cdn.jsdelivr.net/npm/p2p-ckplayer@latest/ckplayer/ckplayer.min.js" charset="UTF-8"></script> <script type="text/javascript"> var videoObject = { container: '#video',//“#”代表容器的ID,“.”或“”代表容器的class variable: 'player',//该属性必需设置,值等于下面的new chplayer()的对象 autoplay:true, html5m3u8:true, video:'<?php echo $_GET['url'] ?>',//视频地址 hlsjsConfig: { debug: false, p2pConfig: { logLevel: 'debug', live: true, // 如果是直播设为true getStats: function (totalP2PDownloaded, totalP2PUploaded, totalHTTPDownloaded) { var total = totalHTTPDownloaded + totalP2PDownloaded; document.querySelector('#info').innerText = `七星p2p比例: ${Math.round(totalP2PDownloaded/total*100)}%, 已加速: ${totalP2PDownloaded}KB, 已分享: ${totalP2PUploaded}KB`; }, } } }; var player = new ckplayer(videoObject); </script> </body> </html>
二、进苹果CMSV10后台--视频--播放器--添加(界面)
基本设置-状态:启用,编码:bjm3u8,名称:bjm3u8,备注: ,目标窗口:当前,解析状态:启用,解析:/ck.php?url=,排序:909,提示:无需安装任何插件,如下图
三、清理后台缓存和浏览器缓存即可