惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Cisco Talos Blog
Cisco Talos Blog
阮一峰的网络日志
阮一峰的网络日志
云风的 BLOG
云风的 BLOG
D
Docker
Vercel News
Vercel News
IT之家
IT之家
Recent Announcements
Recent Announcements
Last Week in AI
Last Week in AI
V
Visual Studio Blog
Engineering at Meta
Engineering at Meta
腾讯CDC
Google DeepMind News
Google DeepMind News
I
InfoQ
博客园 - 三生石上(FineUI控件)
Apple Machine Learning Research
Apple Machine Learning Research
The GitHub Blog
The GitHub Blog
博客园 - Franky
The Cloudflare Blog
A
About on SuperTechFans
有赞技术团队
有赞技术团队
Y
Y Combinator Blog
T
Tenable Blog
P
Proofpoint News Feed
Recorded Future
Recorded Future
Security Latest
Security Latest
H
Hackread – Cybersecurity News, Data Breaches, AI and More
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
博客园 - 聂微东
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Google Online Security Blog
Google Online Security Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Simon Willison's Weblog
Simon Willison's Weblog
The Last Watchdog
The Last Watchdog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
N
News and Events Feed by Topic
TaoSecurity Blog
TaoSecurity Blog
U
Unit 42
The Hacker News
The Hacker News
Martin Fowler
Martin Fowler
T
Threat Research - Cisco Blogs
NISL@THU
NISL@THU
F
Full Disclosure
M
MIT News - Artificial intelligence
人人都是产品经理
人人都是产品经理
Hugging Face - Blog
Hugging Face - Blog
V
V2EX
Project Zero
Project Zero

Rat's Blog - typecho

零基础的萌新搭建属于自己的Typecho/WordPress等博客教程 - Rat's Blog 使用Docker搭建DPlayer视频弹幕接口API后端 - Rat's Blog 小内存VPS一键安装Typecho/WordPress/Zblog/Kodexplorer及整站备份等 - Rat's Blog Caddy环境下一些Web应用程序的配置参考 - Rat's Blog 小内存VPS安装Caddy+PHP 7+Sqlite 3环境,并快速搭建Typecho博客 - Rat's Blog VPS服务器如何优化/加快网站的访问速度 - Rat's Blog Typecho升级助手:一个可以将Typecho升级到最新版本的插件 - Rat's Blog SC private letter: 一个基于serverchan微信推送服务的私信发送站 - Rat's Blog 给WordPress、Emlog等博客网站添加下雪特效,附带Typecho下雪插件 - Rat's Blog
修复官方Dplayer-Typecho插件不能连接弹幕API后端的方法 - Rat's Blog
博主: Rat's · 2019-01-05 · via Rat's Blog - typecho

说明:博主之前发过DPlayer弹幕后端搭建教程→传送门,也说了下HTML代码的使用方法,不过对于Typecho博客来说,插件不能用会很麻烦,加上看见很多使用Typecho的同学对这个还是有点兴趣的,所以就咨询了下某大佬插件修复方法,貌似是播放器版本没更新到最新,然后在这里就说下,有需求的可以用下。

方法

官方插件地址:https://github.com/MoePlayer/DPlayer-Typecho
修复后的地址:https://github.com/menhood/DPlayer-Typecho

1、直接使用
去提供修复后的Github地址下载插件,然后将文件夹名改为DPlayer上传到usr/plugins目录启用即可。

2、自行修复
如果你不放心使用修复后的插件,那么你可以自行替换文件修复,修复方法如下:

1)下载官方提供的旧版本插件,插件地址见上面!
2)然后下载该地址的4个文件:https://github.com/MoePlayer/DPlayer/tree/master/dist
3)将下载的文件复制并替换旧插件dplayer/dist目录的4个文件即可。

使用

由于插件地址使用的弹幕服务器地址默认为官方的,貌似服务器出了问题不能用,这里可以使用博主搭建的API服务器,地址为:https://dplayer.moerats.com/,当然你也可以使用博主提供的方法自行搭建API,教程查看→传送门

提示:由于特殊原因,博主将下面所有例子最开始的[换成了(,到时候使用的时候,将开头的(换成[,即被[]包住即可。

使用方法如下,直接贴近文章里即可!

#默认不自动播放,弹幕开启
(dplayer url="http://xxx.com/xxx.mp4" pic="http://xxx.com/xxx.jpg"/]

#关闭弹幕
(dplayer url="http://xxx.com/xxx.mp4" pic="http://xxx.com/xxx.jpg" danmu="false"/]

#开启自动播放
(dplayer url="http://xxx.com/xxx.mp4" pic="http://xxx.com/xxx.jpg" autoplay="true"/]

#添加额外弹幕源(例:bilibili弹幕),这里和作者的文档有点区别,就是需要在api后面加v3。
(dplayer url="http://xxx.com/xxx.mp4" pic="http://xxx.com/xxx.jpg" autoplay="true" addition="https://api.prprpr.me/dplayer/v3/bilibili?aid=7286894"/]

当然,如果你想假装很多人看的样子,那可以添加额外的bilibili弹幕,这时候不管你放什么视频,B站弹幕都会在上面密密麻麻的滚动。

要是有时候不生效,可以对斜杠/转义一下,比如:

(dplayer url="http:\/\/xxx.com\/xxx.mp4" pic="http:\/\/xxx.com\/xxx.jpg"/]

演示

#这里直接用的B站一个视频,顺便把弹幕也给拉过来了,假装看的人很多吧。

如果该视频播放器不显示的话,刷新一下就行了。


版权声明:本文为原创文章,版权归 Rat's Blog 所有,转载请注明出处!

本文链接:https://www.moerats.com/archives/856/

如教程需要更新,或者相关链接出现404,可以在文章下面评论留言。