Hexo插入音乐

什么是APlayer

https://aplayer.js.org/#/zh-Hans/

安装

npm install aplayer –save

使用

找到node_modules -> aplayer(复制他的dist文件夹)

复制到F:\blog\themes\这里是你模板名称\source下(也就是你的主题配置文件下的source)

在dist文件夹下新建music.js
music.js 代码
const ap = new APlayer({
    container: document.getElementById('aplayer'),
    fixed: true,
    autoplay: true,
    lrcType: 3,
    audio: [
      {
        name: "在水一方",
        artist: '李健',
        url: 'http://other.web.ri01.sycdn.kuwo.cn/resource/n2/31/23/2648161877.mp3',
        cover: 'http://star.kuwo.cn/star/starheads/180/73/49/1131928591.jpg',
        lrc: 'song-post/zaishuiyifang.lrc'
      },
    ]
});

在你想播放的页面插入下面代码,xxx.ejs插入以下代码( < body>< /body>内)

<!-- 插入音乐 -->
    <link rel="stylesheet" href="/dist/APlayer.min.css">
    <div id="aplayer" ></div>
    <script type="text/javascript" src="/dist/APlayer.min.js"></script>
    <script type="text/javascript" src="/dist/music.js"></script>

然后即可播放音乐

转载于:https://blog.csdn.net/weixin_40842539/article/details/87655662


  转载请注明: Asz的博客 Hexo插入音乐

 上一篇
扩盘与WAF问题 扩盘与WAF问题
前言感谢雪师傅的辅助 0x00df -h 查看运行内存大小ll -sh -dhpwd 当前所在的目录top cup占用情况ls -l 权限 -h 大小 -a 所有包含隐藏的 mtr -r [ip]
2019-09-05
下一篇 
Hexo博客配置RSS插件 Hexo博客配置RSS插件
1、安装rss插件在站点根目录下安装 npm install hexo-generator-feed 2、配置_config.yml文件,启用插件# Extensions plugins: hexo-generator-feed #
2019-09-01
  目录