效果:



Hexo官方插件:https://hexo.io/plugins/

需要用到两个播放器插件

两款插件基于 DIYgod 编写的 html5 播放器 APlayerDPlayer 开发

安装插件:

1
2
3
4
$ pwd
/e/GitHup_Data/Hexo_Blog
$ npm install hexo-tag-dplayer --save
$ npm install hexo-tag-aplayer --save

安装成功后,在Markdown文档中添加 APlayer 和 DPlayer 标签即可

APlayer和DPlayer代码:

1
2
#APlayer Usage:
{% aplayer title author url [picture_url, narrow, autoplay, width:xxx, lrc:xxx] %}

1
2
{% aplayer "You Raise Me Up" "Westlife" "http://other.web.ra01.sycdn.kuwo.cn/d5a898b9c8d91e8e4486011b7baccdb4/58a3c3b8/resource/n3/128/69/68/992887695.mp3" "autoplay" %}
{% dplayer "url=http://devtest.qiniudn.com/若能绽放光芒.mp4" "api=http://dplayer.daoapp.io" "pic=http://devtest.qiniudn.com/若能绽放光芒.png" "id=9E2E3368B56CDBB4" "loop=yes" "theme=#FADFA3" "autoplay=false" "token=tokendemo" %}

注:dplayer存在BUG,研究了会但还是不会咋整,就把官方的贴出来了,嘿
参考:https://dplayer.js.org/docs/#/?id=usage
https://github.com/NextMoe/hexo-tag-dplayer
https://github.com/DIYgod/DPlayer
https://login926.top/2016/07/20/HexoMedia/


本作品采用知识共享署名 2.5 中国大陆许可协议进行许可,欢迎转载,但转载请注明来自Jack Wang Blog,并保持转载后文章内容的完整。本人保留所有版权相关权利。
打赏
本文出自”Jack Wang Blog”:http://www.yfshare.vip/2017/02/15/Hexo%E6%8F%92%E4%BB%B6%E4%B9%8B%E9%9F%B3%E4%B9%90%E8%A7%86%E9%A2%91/