moefyit / vuepress-plugin-meting

:cake: A simple plugin connect APlayer, Meting and VuePress.
https://moefyit.github.io/moefy-vuepress/
MIT License
32 stars 2 forks source link
aplayer metingjs plugin vue-aplayer vuepress

vuepress-plugin-meting

:cake: A simple plugin connect APlayer, Meting and VuePress.

npm GitHub stars downloads downloads GitHub license

<Meting server="netease" type="playlist" mid="6838211960" :lrc-type="3"/>

Install

yarn add vuepress-plugin-meting -D
# or use npm
npm i vuepress-plugin-meting -D

Usage

module.exports = {
   plugins: [
      'meting',
      {
         metingApi,
         meting,
         aplayer,
         mobile,
         defaultCover,
      },
   ],
}

使用该插件后将自动注册 <Meting/> 组件与 <APlayer/> 组件,你可以在任意位置使用它们

config.js 中的 meting 选项、aplayer 选项和 mobile 选项是全局 UI 组件的配置项,当 meting 选项被配置后,将自动注册一个全局 UI 组件 <Meting/>(吸底模式),这三个配置项不影响其他组件的配置项

Options

Options 分为 metingApimetingaplayermobiledefaultCover 五部分

metingApi

Metingapi,默认为 @metowolf 提供的 api,你也可以通过自建修改该选项

meting

Meting 相关选项

该 Option 可分别填写 servertypemid

meting: {
  server: "netease",
  type: "playlist",
  mid: "6838211960",
}

也可以只填写 auto

meting: {
   auto: 'https://music.163.com/#/playlist?id=6838211960'
}

aplayer

详情见 vue-aplayer 文档(当前无法访问) vue-aplayer 文档 GitHub 页面

mobile

用于控制全局吸底播放器在移动设备上的一些特殊选项

defaultCover

加载音乐封面时所显示的默认封面图

Examples

// .vuepress/config.js
module.exports = {
   plugins: [
      'meting',
      {
         // 这个 API 是不可用的,只是作为示例而已
         metingApi: 'https://meting.example.com/api/',
         meting: {
            server: 'netease',
            type: 'playlist',
            mid: '6838211960',
         }, // 不配置该项的话不会出现全局播放器
         aplayer: {
            lrcType: 3,
         },
         defaultCover: 'https://nyakku.moe/avatar.jpg',
      },
   ],
}
<!-- about.md -->

<Meting server="netease"
        type="playlist"
        mid="6838211960"
        :lrc-type="3"/>

<!-- 这样就可以在 about.html 页面单独引入一个播放器咯~ -->

Thanks