【自搭博客系统篇四】:给博客添加音乐功能 hexo-tag-aplayer

前言

该操作针对hexo butterfly主题,其他主题可能有所不同

正文

1、安装 hexo-tag-aplayer 插件

npm install --save hexo-tag-aplayer

2、修改根目录下的_config.yml文件配置

aplayer:
  asset_inject: false
  meting: true

3、修改主题配置文件_config.butterfly.yml

# Inject the css and script (aplayer/meting)
aplayerInject:
  enable: true # 开启音乐播放器
  per_page: true #每个页面都有Aplayer

4、添加音乐播放器,有2种方式
①在博客的音乐页面(\source\music\index.md文件)添加(只能在这个页面用,离开了页面自动停止)

---
title: 音乐
date: 2020-11-03 09:58:08
type: "music"
aplayer: true
---
{% meting "2379161415" "netease" "playlist" "autoplay" "mutex:false" "listmaxheight:400px" "preload:none" "theme:#ad7a86"%}

在这里插入图片描述

server可选:netease(网易云音乐),tencent(QQ音乐),kugou(酷狗音乐),xiami(虾米音乐),baidu(百度音乐)。建议网易云
type可选:song(歌曲),playlist(歌单),album(专辑),search(搜索关键字),artist(歌手)。添加单曲选的歌曲,歌单选择playlist,可以自行尝试。
id获取示例: 打开网易云音乐,选择喜欢的歌单,在网页版打开,获取歌单list,填入即可。使用的时候将上边的ID号换为自己喜欢的歌单即可。注意歌单中不能包括VIP音乐,否则无法解析。建议单独建立一个歌单,以后有喜欢的音乐添加进去,网页也会自动同步添加。
lrcType设置为 -1默认显示歌词,放在fixed模式下比较合适。

Aplayer完整配置可选参数表

NameDefaultDescription
containerdocument.querySelector('.aplayer')player container
fixedfalseenable fixed mode, see more details
minifalseenable mini mode, see more details
autoplayfalseaudio autoplay
theme'#b7daff'main color
loop'all'player loop play, values: 'all', 'one', 'none'
order'list'player play order, values: 'list', 'random'
preload'auto'values: 'none', 'metadata', 'auto'
volume0.7default volume, notice that player will remember user setting, default volume will not work after user set volume themselves
audio-audio info, should be an object or object array
audio.name-audio name
audio.artist-audio artist
audio.url-audio url
audio.cover-audio cover
audio.lrc-see more details
audio.theme-main color when switching to this audio, it has priority over the above theme
audio.type'auto'values: 'auto', 'hls', 'normal' or other custom type, see more details
customAudioType-see more details
mutextrueprevent to play multiple player at the same time, pause other players when this player start play
lrcType0see more details
listFoldedfalseindicate whether list should folded at first
listMaxHeight-list max height
storageName'aplayer-setting'localStorage key that store player setting

在这里插入图片描述
重新发布,即可看到音乐播放器效果
在这里插入图片描述
在这里插入图片描述

②全局吸底Aplayer模式,切换博客也不会停止
打开主题配置文件_config.butterfly.yml,播放器参数跟第一种方式一样,自行修改即可

# Inject
# Insert the code to head (before '</head>' tag) and the bottom (before '</body>' tag)
# 插入代码到头部 </head> 之前 和 底部 </body> 之前
inject:
  head:
    - '<style type="text/css">#toggle-sidebar {bottom: 80px}</style>'
  bottom:
    - <div class="aplayer no-destroy" data-id="2379161415" data-server="netease" data-type="playlist" data-fixed="true" data-autoplay="true" data-lrcType="-1"> </div>

最后,如果你想切换页面时,音乐不会中断。请把主题配置文件的 pjax 设为 true即可

# Pjax [Beta]
# It may contain bugs and unstable, give feedback when you find the bugs.
# https://github.com/MoOx/pjax
pjax:
  enable: true
  exclude:

在这里插入图片描述

最后

至此,添加播放器成功,尽情享受吧

SLAM精度评估中的EVO是指使用EVO工具来评估SLAM系统的轨迹误差。EVO是一个开源的工具,用于评估SLAM系统的性能。它提供了一系列命令和功能,可以计算和可视化SLAM系统的轨迹误差。 在EVO中,有几个常用的命令可以用来评估SLAM系统的轨迹误差。其中,evo_traj命令用于评估轨迹误差,可以使用手写的ATE(绝对位姿误差)和RPE(相对位姿误差)来比较SLAM系统的性能。\[1\] 相对位姿误差主要用于比较运动(姿态增量),而不是进行绝对位姿的比较。相对位姿误差可以给出局部精度,例如SLAM系统每米的平移或旋转漂移量。可以使用evo_rpe命令来计算相对位姿误差,并通过设置参数来进行可视化和保存结果。\[2\] 另外,evo_ape命令可以用于计算ATE(绝对位姿误差),并提供了可视化和保存结果的功能。可以使用该命令来评估SLAM系统在KITTI数据集上的性能。\[3\] 总之,EVO是一个用于评估SLAM系统性能的工具,可以通过计算和可视化轨迹误差来评估SLAM系统的精度。可以使用evo_traj、evo_rpe和evo_ape等命令来进行评估和分析。 #### 引用[.reference_title] - *1* *2* [SLAM精度测评——EVO进阶](https://blog.csdn.net/Darlingqiang/article/details/123534388)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [ros中SLAM的EVO、APE测评——SLAM精度测评(一)](https://blog.csdn.net/Yangy_Jiaojiao/article/details/124419966)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值