海洋cms整合dplayer播放器,并自动下一集

  • 2018-12-09
  • 119
  • 2

海洋cms整合文件dplayer.html代码如下

剩下的播放器文件在官网下载,官方下载地址https://github.com/MoePlayer/DPlayer

<!DOCTYPE html>
<html>
<head>
	<title>dplayer播放器</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="/js/player/dplayer/DPlayer.min.css">
	<script type="text/javascript" src="/js/player/dplayer/flv.min.js"></script>
	<script type="text/javascript" src="/js/player/dplayer/hls.min.js"></script>
	<script type="text/javascript" src="/js/player/dplayer/dash.all.min.js"></script>
	<script type="text/javascript" src="/js/player/dplayer/webtorrent.min.js"></script>
	<script type="text/javascript" src="/js/player/dplayer/DPlayer.min.js"></script>
</head>
<body>
<div class="video"></div>
<div id="dplayer"></div>
<script type="text/javascript">
var dp = new DPlayer({
        container: document.getElementById('dplayer'),
        autoplay: true,
        screenshot: true,
		logo:'',//logo地址
        video: {
            url:''+parent.now+'',
            live: 'false',
            type:'auto'
        },
        contextmenu: [

        ]
    });
	dp.on('ended', function (){
        if(parent.nextPage!=''){
            top.location.href = parent.nextPage;
        }
    });//自动下一集
</script>
</body>
</html>

网上还有这个播放器针对M3U8地址的P2P加速器,这个我没有整合进去。
需要的可以替换以上代码中的

<script type="text/javascript" src=/js/player/dplayer/hls.min.js"></script>

替换为

<script type="text/javascript" src="//www.629055.com/dplayer/hls.min.js"></script>

评论

  • 明月回复

    感谢博主。不过。。。那些引用的文件好像在github里找不到啊

    • 一叶知秋回复

      引用的文件,你下载下来就有了,不过,现在海洋官方已经出了DP的播放器了

鄂ICP备09018262号-4

备案鄂公网安备 42010302000542号 - Theme by Qzhai