Typecho Plyr HTML5 自适应本地 mp3/mp4 播放插件

2024-03-14T10:20:00+08:00 | 2 分钟阅读 | 更新于 2024-03-14T10:20:00+08:00

hehe

Typecho Plyr HTML5 自适应本地 mp3/mp4 播放插件
Plyr
简单,轻便,可访问且可自定义的HTML5,YouTube和Vimeo媒体播放器,支持现代浏览器。

更多详情请访问 plyr 官网:https://plyr.io

请参考开源项目自行添加标签:https://plyr.io

既然官方提供了 MP3 播放源码,就一起集成了 MP3 音频播放和 MP4 视频播放功能,整合了其它控件元素,基本上保持与 Plyr 官网样式同步。

使用 Plyr HTML5 样式:

MP3 和移动端效果不提供预览,我自己测试时效果很棒,您可自行测试。

是不是马上觉得使用 Plyr HTML5 样式好看多了?如果您喜欢,就往下看吧。

功能:
PC 端与手机端自适应。
与 Plyr 官方控件样式同步。
只需一个插件,即可播放MP3/MP4。

使用:
MP4:

`<video src="https://xxx.com/xxx.mp4"></video>`

带封面:

`<video poster="https://xxx.com/xxx.jpg" src="https://xxx.com/xxx.mp4"></video>`

MP3:

`<div><audio src="http://xxx.com/xxx.mp3"></audio></div>`

注:此插件已集成 HTML 5 基本按钮元素控件,无需像原生 HTML 5 一样还要写入元素控件,只需一个视频地址即可播放。

由于设置了不自动播放,想设置MP3自动播放的,请添加自动播放 autoplay 标签或者修改源码 autoplay 标签。

目前仅在 Typecho1.0 测试OK,理论支持所有正式版与开发版,并没有加入 Youtube 与优酷、腾讯等在线视频功能,Youtube 被屏蔽,腾讯和优酷视频都有广告,只测试了本地视频播放,如您有兴趣,也可自己加入测试。

由于我设置了自适应,就不需要添加宽高元素了,如与原生元素发生冲突,保留带封面元素再删除其它元素控件,如果还需要添加其他的元素控件,请参考:https://github.com/sampotts/plyr

插件下载:plyr.zip

下载之后自行上传到 Typecho 插件目录修改插件名为:plyr 并启用。

comments powered by Disqus

© 2024 和和日志

🌱 Powered by Hugo with theme Dream.

关于我

Hi…🐟 everyone! I’m Hehe. I’m passionate about computers and the internet, my hobby is playing pool, and I have a >special fondness for games. In the field of computers, I enjoy constantly learning new technologies. Pool is my >way of relieving stress, and gaming is a way for me to interact with friends. I like making new friends, so if you >share these interests, let’s connect and exchange experiences!

2024 年 07 月 19 日更新。

关于留言评论

本博客评论系统用的是 Disqus,如果您要留言 请登录👉 github后进行留言讨论~

赞助我(Sponsor Me)

If you like my works or find them helpful, please consider buying me a cup of coffee ☕️. It inspires me to create and maintain more projects in the future. 🦾

👉 Buy me a coffee

知识共享(Creative Commons)

此网站的所有内容都遵循 CC BY-NC-SA 4.0

社交链接