搭建属于自己的PHP视频弹幕播放器,带后台管理

更多视频测试: https://jiejie.uk/xjj/fuli/

推荐使用

修复内容

1,支持画中画功能
2,修复弹幕后台管理登录系统后门
3,修复安装程序界面没有样式问题
4,后台登录支持输出账号与密码了,更改用户名与密码请修改dmku文件夹下的config.inc.php文件
5,修复右键菜单点击后自动在新窗口打开一个空白页面的bug

更新记录

2021年1月20日
修复后台不能编辑和删除弹幕,安装好后修改一下。

1. /dmku/index.php 第六行

$_configx = require_once('config.inc.php');
$_configx = require_once('config.inc.php');
$_configx = require_once('config.inc.php');

改为

$_configx = require('config.inc.php');
$_configx = require('config.inc.php');
$_configx = require('config.inc.php');

2. /admin/login.php 第65行

setcookie("zt", $cookielock, time()+86400);
setcookie("zt", $cookielock, time()+86400);
setcookie("zt", $cookielock, time()+86400);

改为

setcookie("zt", $cookielock, time()+86400, '/');
setcookie("zt", $cookielock, time()+86400, '/');
setcookie("zt", $cookielock, time()+86400, '/');

2020年11月23日
修复设置logo导致播放器崩溃问题。

2020年11月06日
修复弹幕接口可被非法利用问题,上一版本升级到此版本覆盖dmku目录下的index.php,player/js文件下的yzmplayer.js即可平滑升级。
2020年10月26日
删除无用设置项,删除js对其他链接的无用请求。上一版本升级到此版本覆盖admin与player两个文件夹文件即可平滑升级。
2020年9月15日
解决视频倍速功能部分情况下无法点击的问题。
2020年8月15日
修复进度条拖动部分情况下触发的bug,默认隐藏加载动画,隐藏视频信息屏蔽词汇,隐藏弹幕规则。
2020年8月10日
修复上一版本马虎导致的弹幕功能失效问题!
2020年7月30日
图标本地化,去除对jsdelivr的依赖

下载

最新版下载:https://qqdie.lanzoui.com/iYzkbionn7a 密码:apkq

备用下载:bilibili20201123.zip

其他旧版本链接已删除,建议使用最新的这个版本

【源码无加密,无后门,无授权!!!】

安装教程

1,访问/dmku/index.php,填写数据库信息进行安装
2,安装完成后访问/admin/index.php登录后台,默认用户名为admin密码为123456

播放器使用

基本使用:https://localhost/player/?url=你的视频地址这样就可以播放视频了。player文件夹下的index.php第12行可修改是否显示加载动画,视频信息屏蔽词汇,弹幕规则(这三项默认都是隐藏状态的)。
count.dat权限需要有写入权限,无脑777即可。

其他问题

修改用户名与密码的话修改dmku/config.inc.php文件即可
如何显示加载动画:index.php第12行删除#loading-box,就显示了
如何显示弹幕规则:index.php第12行删除.dmrules就显示了

修改版作者:https://qqdie.com/archives/2338.html

插入播放器

以下代码仅供参考(固定高度)

<iframe src="https://播放器域名/player/?url=视频链接" allowfullscreen="" mozallowfullscreen="" msallowfullscreen="" oallowfullscreen="" webkitallowfullscreen="" width="100%" height="500px" frameborder="0"></iframe>
<iframe src="https://播放器域名/player/?url=视频链接" allowfullscreen="" mozallowfullscreen="" msallowfullscreen="" oallowfullscreen="" webkitallowfullscreen="" width="100%" height="500px" frameborder="0"></iframe>
<iframe src="https://播放器域名/player/?url=视频链接" allowfullscreen="" mozallowfullscreen="" msallowfullscreen="" oallowfullscreen="" webkitallowfullscreen="" width="100%" height="500px" frameborder="0"></iframe>

几乎完美的自适应代码,纯css,支持16:9,4:3.(推荐使用)

<style type="text/css">
.video-container { display: block; position: relative; width: 100%; height: 0; overflow: hidden; box-sizing: border-box } .video-container iframe, .video-container video { position: absolute; top: 0; left: 0; border: none; width: 100%; height: 100% } .video-ratio-16by9 { padding-bottom: 56.25% /* 9/16 */ } .video-ratio-4by3 { padding-bottom: 75% /* 3/4 */ }
</style>
<div class="video-container video-ratio-16by9">
<iframe src="https://播放器域名/player/?url=视频链接" allowfullscreen="" mozallowfullscreen="" msallowfullscreen="" oallowfullscreen="" webkitallowfullscreen="" frameborder="0"></iframe>
</div>
<style type="text/css">
.video-container { display: block; position: relative; width: 100%; height: 0; overflow: hidden; box-sizing: border-box } .video-container iframe, .video-container video { position: absolute; top: 0; left: 0; border: none; width: 100%; height: 100% } .video-ratio-16by9 { padding-bottom: 56.25% /* 9/16 */ } .video-ratio-4by3 { padding-bottom: 75% /* 3/4 */ }
</style>
<div class="video-container video-ratio-16by9">
<iframe src="https://播放器域名/player/?url=视频链接" allowfullscreen="" mozallowfullscreen="" msallowfullscreen="" oallowfullscreen="" webkitallowfullscreen="" frameborder="0"></iframe>
</div>
<style type="text/css"> .video-container { display: block; position: relative; width: 100%; height: 0; overflow: hidden; box-sizing: border-box } .video-container iframe, .video-container video { position: absolute; top: 0; left: 0; border: none; width: 100%; height: 100% } .video-ratio-16by9 { padding-bottom: 56.25% /* 9/16 */ } .video-ratio-4by3 { padding-bottom: 75% /* 3/4 */ } </style> <div class="video-container video-ratio-16by9"> <iframe src="https://播放器域名/player/?url=视频链接" allowfullscreen="" mozallowfullscreen="" msallowfullscreen="" oallowfullscreen="" webkitallowfullscreen="" frameborder="0"></iframe> </div>

感谢作者提供代码:https://kai73002981.blogspot.com/2020/09/responsive-video-player.html

原版

2020-12-10:后台有严重bug,会泄露后台密码,建议大家等解决后再搭建!!!

2020-12-11:由loc大佬longkulo提供修复方案,下载替换后台文件即可。

2022-09-20:下载链接已失效,建议使用修改版!

下载链接:admin.zip

修改说明

原作者:京都一只喵

  1. 解密 yzmplayer.js 文件
  2. 修复了视频弹幕非独立的问题
  3. 兼容了 PHP7.X,在 PHP7.4 环境测试通过
  4. 更新版本号至 v1.2.1
  5. 重写了使用说明
  6. 可播放自定义mp4,m3u8等链接,每一条链接都有属于自己的弹幕ID。
  7. 后台预览

使用方法

https://github.com/newcdn/bilibili

  1. 解压到网站根目录
  2. 登录 你的域名/dmku 进行配置数据库
  3. 修改播放器后台密码 dmku/config.inc.php
  4. 登录后台 你的域名/admin 密码为第3步修改的密码
  5. 播放器功能可后台设置
  6. 建议使用本人委托大佬修改的 yzmplayer.js 文件,修复了点击播放器右键的视频统计信息按钮不会打开一个新窗口。
https://player.tvv.tw/player/js/yzmplayer.js?v=20201210
//自行复制替换yzmplayer.js的内容,如果出现中文乱码,请设置网页编码为utf-8
//右键内容修改在yzmplayer.js的1626行
https://player.tvv.tw/player/js/yzmplayer.js?v=20201210
//自行复制替换yzmplayer.js的内容,如果出现中文乱码,请设置网页编码为utf-8
//右键内容修改在yzmplayer.js的1626行
https://player.tvv.tw/player/js/yzmplayer.js?v=20201210 //自行复制替换yzmplayer.js的内容,如果出现中文乱码,请设置网页编码为utf-8 //右键内容修改在yzmplayer.js的1626行

参数说明(player/index.php)

"av":'<?php echo($_GET['av']);?>',//B站av号,用于调用弹幕
"url":"<?php echo($_GET['url']);?>",//视频链接
"id":"<?php echo($_GET['url']);?>",//视频id
"sid":"<?php echo($_GET['sid']);?>",//集数id
"pic":"<?php echo($_GET['pic']);?>",//视频封面
"title":"<?php echo($_GET['name']);?>",//视频标题
"next":"<?php echo($_GET['next']);?>",//下一集链接
"user": '<?php echo($_GET['user']);?>',//用户名
"group": "<?php echo($_GET['group']);?>",//用户组
"av":'<?php echo($_GET['av']);?>',//B站av号,用于调用弹幕
"url":"<?php echo($_GET['url']);?>",//视频链接
"id":"<?php echo($_GET['url']);?>",//视频id
"sid":"<?php echo($_GET['sid']);?>",//集数id
"pic":"<?php echo($_GET['pic']);?>",//视频封面
"title":"<?php echo($_GET['name']);?>",//视频标题
"next":"<?php echo($_GET['next']);?>",//下一集链接
"user": '<?php echo($_GET['user']);?>',//用户名
"group": "<?php echo($_GET['group']);?>",//用户组
"av":'<?php echo($_GET['av']);?>',//B站av号,用于调用弹幕 "url":"<?php echo($_GET['url']);?>",//视频链接 "id":"<?php echo($_GET['url']);?>",//视频id "sid":"<?php echo($_GET['sid']);?>",//集数id "pic":"<?php echo($_GET['pic']);?>",//视频封面 "title":"<?php echo($_GET['name']);?>",//视频标题 "next":"<?php echo($_GET['next']);?>",//下一集链接 "user": '<?php echo($_GET['user']);?>',//用户名 "group": "<?php echo($_GET['group']);?>",//用户组

请求示例

示例网站

https://tvv.tw/xjj/fuli/

基本

http://localhost/player/?url=https://cdn.jsdelivr.net/gh/MoGuJ/Video-Bed/Your.Name/playlist.m3u8

高级

除了 url 参数,其他都可以省略

http://localhost/player/?url=https://cdn.jsdelivr.net/gh/MoGuJ/Video-Bed/Your.Name/playlist.m3u8&next=https://cdn.jsdelivr.net/gh/MoGuJ/Video-Bed/Your.Name/playlist.m3u8&sid=1&pic=https://img.xx.com/1.png&user=游客&group=1&name=测试

温馨提示:本文最后更新于2023-03-07 23:39:31,某些文章具有时效性,若有错误或已失效,请在下方留言
© 版权声明
THE END
喜欢就支持一下吧
点赞11 分享
Judge each day not by the harvest you reap but by the seeds you plant.
不要问自己收获了多少果实,而是要问自己今天播种了多少种子
评论 共1条
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

夸夸
夸夸
还有吗!没看够!
取消
昵称表情代码图片
    • 头像哈哈怪广东省东莞市 电信0