MP4/M3U8视频解析PHP源码 for DPlayer

下面应网友要求来份DPlayer播放器的视频解析

1、支持mp4/m3u8/flv/hls-m3u8等格式

2、使用方法:index.php?url=

3、支持p2p加速

<!DOCTYPE html>
<head>
<title>DP播放器P2P加速版</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 name="Viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />
<style type="text/css">*{margin: 0;padding: 0;font-family: "Microsoft YaHei",SimHei,"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;}img{border: 0;}a{color:inherit;text-decoration: none;color:#4B7E9D;}a:hover{text-decoration: underline;}body{background:#000;padding: 0;margin: 0;width:100%;height:100%;color:#fff;overflow:hidden;cursor: default;}.error{position:absolute;width:100%;height:100%;text-align:center;top:50%;margin:-30px 0 0 0;z-index:10;}.player,#dpplayer{position:absolute;width:100%;height:100%;}.dplayer-menu{display:none !important;}.torrentnum{padding: 5px;position: absolute;font-size: 12px;}</style>
<link rel="stylesheet" href="dplayer/dplayer.min.css" type="text/css" />
<script type="text/javascript" src="dplayer/hls.min.js"></script>
<script type="text/javascript" src="dplayer/flv.min.js"></script>
<script type="text/javascript" src="dplayer/dplayer.min.js"></script>
<script type="text/javascript" src="//cdn.jsdelivr.net/npm/ngcdn-dist" charset="utf-8"></script>
<script type="text/javascript" src="//cdn.bskchina.cn/p2p/p2p.js"></script>
<script type="text/javascript" src="//cdn.btjson.com/p2pjs/1.1/p2p.js"></script>
<script type="text/javascript">
window.onload = function(){
var dp = new DPlayer({
container:document.getElementById('dpplayer'),
autoplay:true,
allowfullscreen:true,
preload: 'auto',
logo: 'img/logo.png',
volume: 0.7,
video:{
quality:[{
type:'auto',
name:'流畅',
url:'<?php echo $_GET["url"];?>'
},{
name:'高清',
url:'<?php echo $_GET["url"];?>'
},{
name:'超清',
url:'<?php echo $_GET["url"];?>'
}],
defaultQuality:0
}
});
dp.play();
};
</script>
</head>
<body>
<div id="dpplayer"></div>
</body>
</html>

复制上面的内容另外为index.php,播放器按上面的路径自己下载放就行了,不会的下方回复下载

最新更新
修复不能播放MP4
修复打开不能自动播放
添加LOGO //默认50px x 50px,其他尺寸改css
添加资源自动加载
播放器JS/CSS本地化
添加P2P加速

点赞