Hervorragende Software und praktische Tutorials
Apple CMS stellt Dplayer so ein, dass die nächste Episode automatisch abgespielt wird
In der Konfiguration des Apple CMS wird der Standardplayer weder automatisch abgespielt, noch wird automatisch die nächste Folge des Videos abgespielt. Sie müssen den Dplayer-Code manuell ändern. Der Dplayer ist derzeit im Internet sehr beliebt und bietet hervorragende Leistung und Funktionen. Sehen wir uns an, wie man den Dplayer konfiguriert.
Wer ist Dplayer?
DPlayer ist ein toller HTML5-Videoplayer für Aufzählungskommentare, mit dem Benutzer ganz einfach Videos und Aufzählungskommentare erstellen können.
DPlayer-Website-Adresse:https://dplayer.js.org/
Github-Projektadresse:https://github.com/DIYgod/DPlayer
Integrieren Sie den Dplayer-Player, um den Speicher zu erhöhen, die P2P-Wiedergabe zu ermöglichen und automatisch die nächste Episode des Dplayer-Player-Codes abzuspielen
Ersetzen Sie den folgenden Dplayer-Player-Code, ersetzen Sie das Verzeichnis Apple CMS System static/player/dplayer.html und ersetzen Sie den gesamten Inhalt.
<!DOCTYPE html>
<html>
<head>
<title>dplayer 1.27.0 Player p2p-Beschleunigung + Speicherwiedergabe</title>
<meta http-equiv="content-type" content="text/html;charset=UTF-8"/>
<meta http-equiv="content-language" content="zh-CN"/>
<meta http-equiv="X-UA-Compatible" content="chrome=1"/>
<meta http-equiv="pragma" content="no-cache"/>
<meta http-equiv="expires" content="0"/>
<meta name="referrer" content="never"/>
<meta name="renderer" content="webkit"/>
<meta name="msapplication-tap-highlight" content="no"/>
<meta name="HandheldFriendly" content="true"/>
<meta name="x5-page-mode" content="app"/>
<meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" id="viewport" name="viewport">
<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}
#stats{position:fixed;top:5px;left:8px;font-size:12px;color:#fdfdfd;text-shadow:1px 1px 1px #000, 1px 1px 1px #000}
#playerCnt{width:100%;height:100%;}
</style>
<link rel="stylesheet" href="/static/player/dplayer/DPlayer.min.css">
<script type="text/javascript" src="/static/player/dplayer/flv.min.js"></script>
<script type="text/javascript" src="/static/player/dplayer/hls.min.js"></script>
<script type="text/javascript" src="/static/player/dplayer/dash.all.min.js"></script>
<script type="text/javascript" src="/static/player/dplayer/webtorrent.min.js"></script>
<script type="text/javascript" src="/static/player/dplayer/DPlayer.min.js"></script>
</head>
<body style="background:#000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" oncontextmenu="window.event.returnValue=false">
<div id="playerCnt"></div>
<div id="stats"></div>
<script language="Javascript">
document.oncontextmenu=new Function("event.returnValue=false");
document.onselectstart=new Function("event.returnValue=false");
</script>
<script src="https://cdn.jsdelivr.net/npm/cdnbye@latest"></script>
<script>
var type='normal';
var live=false;
if(parent.MacPlayer.PlayUrl.indexOf('.m3u8')>-1){
type='hls';
live=true;
}
else if(parent.MacPlayer.PlayUrl.indexOf('magnet:')>-1){
type='webtorrent';
}
else if(parent.MacPlayer.PlayUrl.indexOf('.flv')>-1){
type='flv';
}
else if(parent.MacPlayer.PlayUrl.indexOf('.mpd')>-1){
type='dash';
}
var webdata = {
set:function(key,val){
window.sessionStorage.setItem(key,val);
},
get:function(key){
return window.sessionStorage.getItem(key);
},
del:function(key){
window.sessionStorage.removeItem(key);
},
clear:function(key){
window.sessionStorage.clear();
}
};
var _peerId = '', _peerNum = 0, _totalP2PDownloaded = 0, _totalP2PUploaded = 0;
var dp = new DPlayer({
container: document.getElementById('playerCnt'),
autoplay: true, //自动播放视频,不支持移动浏览器
volume: 1.0, //声音
preload: 'auto',//预加载的方式可以是'none''metadata''auto',默认值:'auto'
hotkey: true, //绑定热键,包括左右键和空格,默认值:true
screenshot: true, //截屏
theme: '#28FF28',//主题颜色
video: {
url: parent.MacPlayer.PlayUrl,//播放地址
type: 'customHls', //播放协议
pic: 'https://yingyinjia.top/HB/loading.png', // 视频封面
customType: {
'customHls': function (video, player) {
const hls = new Hls({
debug: false,
// Other hlsjsConfig options provided by hls.js
p2pConfig: {
logLevel: false,
live: false, // 如果是直播设为true
// Other p2pConfig options provided by CDNBye
getStats: function (totalP2PDownloaded, totalP2PUploaded, totalHTTPDownloaded) {
console.warn(totalP2PDownloaded ${totalP2PDownloaded} totalHTTPDownloaded ${totalHTTPDownloaded}
; hls.loadSource(video.src); hls.attachMedia(video); } } }, Kontextmenü: [ //Barrage-Einstellungen] }); dp.seek(webdata.get('pay'+parent.MacPlayer.PlayUrl)); setInterval(function(){ webdata.set('pay'+parent.MacPlayer.PlayUrl,dp.video.currentTime); },1000); dp.on('stats', function (stats) { _totalP2PDownloaded = stats.totalP2PDownloaded; _totalP2PUploaded = stats.totalP2PUploaded; updateStats(); }); dp.on('peerId', function (peerId) { _peerId = peerId; }); dp.on('peers', function (peers) { _peerNum = peers.length; updateStats(); }); dp.on('ended', function (){ if(parent.MacPlayer.PlayLinkNext!=''){ top.location.href = parent.MacPlayer.PlayLinkNext; } }); function updateStats() { var text = 'P2P-Sharing ist aktiviert' + (_totalP2PUploaded/1024).toFixed(2) + 'MB' + 'Beschleunigt' + (_totalP2PDownloaded/1024).toFixed(2) + 'MB' + 'Dieser Film hat ' + _peerNum + ' Fans, die ihn ansehen'; //document.getElementById('stats').innerText = text }
</script>
</body>
</html>