大错社区

 找回密码
 免费注册

QQ登录

只需一步,快速开始

[开发] MP4/M3U8视频解析PHP源码 for DPlayer

[复制链接]
admin 发表于 2018-10-25 01:58:11 | 显示全部楼层 |阅读模式

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

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

3、支持p2p加速

  1. <!DOCTYPE html>
  2. <head>
  3. <title>DP播放器P2P加速版</title>
  4. <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
  5. <meta http-equiv="content-language" content="zh-CN" />
  6. <meta http-equiv="X-UA-Compatible" content="chrome=1" />
  7. <meta http-equiv="pragma" content="no-cache" />
  8. <meta http-equiv="expires" content="0" />
  9. <meta name="referrer" content="never" />
  10. <meta name="renderer" content="webkit" />
  11. <meta name="msapplication-tap-highlight" content="no" />
  12. <meta name="HandheldFriendly" content="true" />
  13. <meta name="x5-page-mode" content="app" />
  14. <meta name="Viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />
  15. <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>
  16. <link rel="stylesheet" href="dplayer/dplayer.min.css" type="text/css" />
  17. <script type="text/javascript" src="dplayer/hls.min.js"></script>
  18. <script type="text/javascript" src="dplayer/flv.min.js"></script>
  19. <script type="text/javascript" src="dplayer/dplayer.min.js"></script>
  20. <script type="text/javascript" src="//cdn.jsdelivr.net/npm/ngcdn-dist" charset="utf-8"></script>
  21. <script type="text/javascript" src="//cdn.bskchina.cn/p2p/p2p.js"></script>
  22. <script type="text/javascript" src="//cdn.btjson.com/p2pjs/1.1/p2p.js"></script>
  23. <script type="text/javascript">
  24. window.onload = function(){
  25. var dp = new DPlayer({
  26. container:document.getElementById('dpplayer'),
  27. autoplay:true,
  28. allowfullscreen:true,
  29. preload: 'auto',
  30. logo: 'img/logo.png',
  31. volume: 0.7,
  32. video:{
  33. quality:[{
  34. type:'auto',
  35. name:'流畅',
  36. url:'<?php echo $_GET["url"];?>'
  37. },{
  38. name:'高清',
  39. url:'<?php echo $_GET["url"];?>'
  40. },{
  41. name:'超清',
  42. url:'<?php echo $_GET["url"];?>'
  43. }],
  44. defaultQuality:0
  45. }
  46. });
  47. dp.play();
  48. };
  49. </script>
  50. </head>
  51. <body>
  52. <div id="dpplayer"></div>
  53. </body>
  54. </html>
复制代码

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


参考文档

https://www.helloweba.net/javascript/571.html
https://www.helloweba.net/javascript/570.html
http://f2ex.cn/dplayer-html5-video-player/
https://www.bootcdn.cn/dplayer/


pursuer 发表于 2018-10-25 03:22:36 | 显示全部楼层
这是啥意思
pursuer 发表于 2018-10-25 03:33:38 | 显示全部楼层
仔细看后,明白了。谢谢
pursuer 发表于 2018-10-25 04:58:25 | 显示全部楼层
测试了一下,很不错,喜欢
pins8 发表于 2018-10-25 14:03:50 | 显示全部楼层
本帖最后由 pins8 于 2018-10-25 14:07 编辑

这个我上个月已经用了
就是这个清晰度切换不知道怎么搞 和后天怎么结合

看看我的   https://dp.dapigu.cc/index.php?url=
您需要登录后才可以回帖 登录 | 免费注册

本版积分规则

QQ|Archiver|手机版|小黑屋|大错网络

GMT+8, 2019-5-20 20:41 , Processed in 0.063826 second(s), 21 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表