将军网-专注于免费分享最新的QQ活动技术软件教程!

苹果CMSV10本地化Dplayer增加记忆播放+自动下一集方法

将军网 技术教程

为Dplayer播放器增加记忆播放功能!顺便加入了IE兼容模式不能播放的提醒!

话不多说,直接放代码!

 

<!--代码开源,透明,请勿用于商业用途,完全开源模式,供大家一起探讨研究-->
<!-
<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">
	<style type="text/css">
	html,body{width:100%;height:100%; padding:0; margin:0;}
	#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 marginwidth="0" marginheight="0">
<div id="playerCnt"></div>
<script type="text/javascript">
    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 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 dp = new DPlayer({
        container: document.getElementById('playerCnt'),
        autoplay: true,
        screenshot: false,
        video: {
            url: parent.MacPlayer.PlayUrl,
            live: live,
            type:type,
        },
         volume: 1.0,
         preload: 'auto',
         theme: '#28FF28',
         contextmenu: [

        ]
    });
	dp.seek(webdata.get('pay'+parent.MacPlayer.PlayUrl));
	setInterval(function(){
		webdata.set('pay'+parent.MacPlayer.PlayUrl,dp.video.currentTime);
	},1000);
        dp.on('ended', function (){
        if(parent.MacPlayer.PlayLinkNext!=''){
            top.location.href = parent.MacPlayer.PlayLinkNext;
        }
    });
if ((navigator.userAgent.indexOf('MSIE') >= 0)
			|| (navigator.userAgent.indexOf('Trident') >= 0)) {
		alert("\u517c\u5bb9\u6a21\u5f0f\u0020\u6613\u4ea7\u751f\u64ad\u653e\u95ee\u9898\uff0c

\u8bf7\u5c06\u6d4f\u89c8\u5668\u8bbe\u7f6e\u4e3a\u0020\u6781\u901f\u6a21\u5f0f\uff01");
     }
       try{
		//document.getElementById('playerCnt').style.height = parent.MacPlayer.Height + 'px';
	}
	catch(e){}
</script>
</body>
</html>

 

 

复制以上代码,替换dplayer.html即可!

免责声明:

本站提供的资源,都来自网络,版权争议与本站无关,所有内容及软件的文章仅限用于学习和研究目的。不得将上述内容用于商业或者非法用途,否则,一切后果请用户自负,我们不保证内容的长久可用性,通过使用本站内容随之而来的风险与本站无关,您必须在下载后的24个小时之内,从您的电脑/手机中彻底删除上述内容。如果您喜欢该程序,请支持正版软件,购买注册,得到更好的正版服务。侵删请致信E-mail: av0000@88.com 云盘默认下载密码:1214

同类推荐
评论列表

热门文章
随机推荐
热门标签