├── .github └── workflows │ └── npm-publish.yml ├── .gitignore ├── .vscode └── extensions.json ├── LICENSE ├── README.md ├── package.json ├── pnpm-lock.yaml ├── src ├── client │ ├── components │ │ ├── APlayer │ │ │ └── index.ts │ │ ├── Meting │ │ │ ├── index.ts │ │ │ └── meting.ts │ │ └── MetingGlobal │ │ │ └── index.ts │ └── index.ts ├── export.ts ├── index.ts └── utils │ ├── meting.ts │ └── module-shim.d.ts └── tsconfig.json /.github/workflows/npm-publish.yml: -------------------------------------------------------------------------------- 1 | # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created 2 | # For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages 3 | 4 | name: Node.js Package 5 | 6 | on: 7 | release: 8 | types: [created] 9 | 10 | jobs: 11 | build: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - name: Checkout 15 | uses: actions/checkout@v3 16 | 17 | - name: Install pnpm 18 | uses: pnpm/action-setup@v4 19 | 20 | - name: 设置 Node.js 21 | uses: actions/setup-node@v4 22 | with: 23 | node-version: 18 24 | registry-url: https://registry.npmjs.org/ 25 | cache: "pnpm" 26 | - name: 安装依赖 27 | run: pnpm install --frozen-lockfile 28 | - name: 编译 29 | run: pnpm build 30 | - name: 发布 31 | run: npm publish 32 | env: 33 | NODE_AUTH_TOKEN: ${{secrets.npm_token}} 34 | 35 | 36 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | lib 14 | *.local 15 | 16 | # Editor directories and files 17 | .vscode/* 18 | !.vscode/extensions.json 19 | .idea 20 | .DS_Store 21 | *.suo 22 | *.ntvs* 23 | *.njsproj 24 | *.sln 25 | *.sw? 26 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": ["Vue.volar", "Vue.vscode-typescript-vue-plugin"] 3 | } 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 oragekk 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # vuepress-plugin-Meting2 2 | 3 | :cake: A simple plugin Support vuepress2.x based on Aplayer+Meting 4 | 5 |

6 | npm 7 | GitHub stars 8 | downloads 9 | downloads 10 | GitHub license 11 |

12 | 13 | ## Install 14 | 15 | ```bash 16 | # use yarn 17 | yarn add vuepress-plugin-meting2 -D 18 | # or use npm 19 | npm i vuepress-plugin-meting2 -D 20 | # or use pnpm 21 | pnpm add vuepress-plugin-meting2 -D 22 | ``` 23 | 24 | ## Usage 25 | ```javascript 26 | plugins: [ 27 | metingPlugin({ 28 | metingOptions: { 29 | global:true, // 开启关闭全局播放器 30 | server: "tencent", 31 | api: "https://api.injahow.cn/meting/?server=:server&type=:type&id=:id&auth=:auth&r=:r", 32 | type: "playlist", 33 | mid: "851947617", 34 | }, 35 | }), 36 | ]; 37 | ``` 38 | 使用该插件后将自动注册 `` 组件与 `` 组件,你可以在任意位置使用它们 39 | 40 | - `` 组件支持 `meting` Options 和 `aplayer` Options,其中 `aplayer` 的 `audio` 选项将自动通过 metingApi 获取,如果想要额外添加 `audio` 的话,可以通过 `additionalAudios` 选项实现 41 | - `` 组件支持 `aplayer` Options,当然,你需要自行提供 `audio` 音乐源 42 | 43 | ## Options 44 | 45 | Options 分为 `aplayerOptions`、`metingOptions`、`additionalAudios` 三部分 46 | 47 | ### aplayerOptions 48 | > 详情见 [aplayer 文档](https://aplayer.js.org/#/zh-Hans/) 49 | 50 | #### 参数 51 | 52 | | 名称 | 默认值 | 描述 | 53 | | --------------- | ---------------------------------- | ------------------------------------------------------------ | 54 | | container | document.querySelector('.aplayer') | 播放器容器元素 | 55 | | fixed | false | 开启吸底模式, [详情](https://aplayer.js.org/#/home?id=fixed-mode) | 56 | | mini | false | 开启迷你模式, [详情](https://aplayer.js.org/#/home?id=mini-mode) | 57 | | autoplay | false | 音频自动播放 | 58 | | theme | '#b7daff' | 主题色 | 59 | | loop | 'all' | 音频循环播放, 可选值: 'all', 'one', 'none' | 60 | | order | 'list' | 音频循环顺序, 可选值: 'list', 'random' | 61 | | preload | 'auto' | 预加载,可选值: 'none', 'metadata', 'auto' | 62 | | volume | 0.7 | 默认音量,请注意播放器会记忆用户设置,用户手动设置音量后默认音量即失效 | 63 | | audio | - | 音频信息, 应该是一个对象或对象数组 | 64 | | audio.name | - | 音频名称 | 65 | | audio.artist | - | 音频艺术家 | 66 | | audio.url | - | 音频链接 | 67 | | audio.cover | - | 音频封面 | 68 | | audio.lrc | - | [详情](https://aplayer.js.org/#/home?id=lrc) | 69 | | audio.theme | - | 切换到此音频时的主题色,比上面的 theme 优先级高 | 70 | | audio.type | 'auto' | 可选值: 'auto', 'hls', 'normal' 或其他自定义类型, [详情](https://aplayer.js.org/#/home?id=mse-support) | 71 | | customAudioType | - | 自定义类型,[详情](https://aplayer.js.org/#/home?id=mse-support) | 72 | | mutex | true | 互斥,阻止多个播放器同时播放,当前播放器播放时暂停其他播放器 | 73 | | lrcType | 0 | [详情](https://aplayer.js.org/#/home?id=lrc) | 74 | | listFolded | false | 列表默认折叠 | 75 | | listMaxHeight | - | 列表最大高度 | 76 | | storageName | 'aplayer-setting' | 存储播放器设置的 localStorage key | 77 | | lrcDisplay | 'hide' | 是否默认显示歌词,可选值'show','hide','toggle' | 78 | ### metingOptions 79 | 80 | | 名称 | 默认值 | 描述 | 81 | | -------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | 82 | | global | false | 是否启用全局播放器 | 83 | | mid | - | MetingApi 中的 id 参数,即资源 ID | 84 | | server | netease | MetingApi 中的 server 参数,即音乐平台 | 85 | | type | song | MetingApi 中的 type 参数,即资源类型(播放列表、单曲、专辑等) | 86 | | auto | | 资源 url,填写后可通过资源 url 自动解析资源平台、类型、ID,上述三个选项将被覆盖(本参数仅支持 netease、tencent、xiami 三平台) | 87 | | auth | auth | | 88 | | api | https://api.i-meto.com/meting/api?server=:server&type=:type&id=:id&r=:r | Meting APi 服务地址(如不可用自行替换) | 89 | | list | [] | 数组,除 list 外其他所有项 | 90 | | aplayerOptions | - | 全局Meting的APlayer配置 | 91 | 92 | ### additionalAudios 93 | 94 | - additionalAudios 95 | 96 | - 类型:`Array