From 4b5b7956c73168a096e77906178ab774cf73d5e2 Mon Sep 17 00:00:00 2001 From: Miao_Spring <539943419@qq.com> Date: Fri, 27 Sep 2024 00:42:15 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=94=A8aplayer=E9=9A=8F=E4=BE=BF?= =?UTF-8?q?=E5=81=9A=E4=BA=86=E4=B8=80=E4=B8=AA=E9=9F=B3=E4=B9=90=E6=8F=92?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + pnpm-lock.yaml | 27 ++++++ src/plugins/miaoMusicPlayer/export.ts | 33 +++++++ .../miaoMusicPlayer/miaoMusicPlayerDemo.vue | 73 +++++++++++++++ src/plugins/miaoPluginTemplate/template.vue | 4 +- .../miaoVideoPlayer/miaoVideoPlayer.vue | 88 +++++++++++-------- .../xgplayer-vue-frame/fakeRoot.vue | 6 +- .../xgplayer-vue-frame/xgplayer-vue-frame.ts | 1 - 8 files changed, 186 insertions(+), 47 deletions(-) create mode 100644 src/plugins/miaoMusicPlayer/export.ts create mode 100644 src/plugins/miaoMusicPlayer/miaoMusicPlayerDemo.vue diff --git a/package.json b/package.json index 4b34f23..c2a9807 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "@codemirror/lang-yaml": "^6.1.1", "@vicons/ionicons5": "^0.12.0", "aes-js": "^3.1.2", + "aplayer": "^1.10.1", "axios": "^1.7.3", "codemirror": "^6.0.1", "copy-to-clipboard": "^3.3.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1e8a8c2..fd02d65 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -47,6 +47,9 @@ importers: aes-js: specifier: ^3.1.2 version: 3.1.2 + aplayer: + specifier: ^1.10.1 + version: 1.10.1 axios: specifier: ^1.7.3 version: 1.7.3 @@ -606,6 +609,9 @@ packages: resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} engines: {node: '>= 8'} + aplayer@1.10.1: + resolution: {integrity: sha512-HAfyxgCUTLAqtYlxzzK9Fyqg6y+kZ9CqT1WfeWE8FSzwspT6oBqWOZHANPHF3RGTtC33IsyEgrfthPDzU5r9kQ==} + aproba@2.0.0: resolution: {integrity: sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==} @@ -629,6 +635,9 @@ packages: balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + balloon-css@0.5.2: + resolution: {integrity: sha512-zheJpzwyNrG4t39vusA67v3BYg1HTVXOF8cErPEHzWK88PEOFwgo6Ea9VHOgOWNMgeuOtFVtB73NE2NWl9uDyQ==} + binary-extensions@2.3.0: resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==} engines: {node: '>=8'} @@ -1019,6 +1028,9 @@ packages: resolution: {integrity: sha512-Aweb9unOEpQ3ezu4Q00DPvvM2ZTUitJdNKeP/+uQgr1IBIqu574IaZoURId7BKtWMREwzKa9OgzPzezWGPWFQw==} engines: {node: ^10 || ^12 || >=14} + promise-polyfill@7.1.0: + resolution: {integrity: sha512-P6NJ2wU/8fac44ENORsuqT8TiolKGB2u0fEClPtXezn7w5cmLIjM/7mhPlTebke2EPr6tmqZbXvnX0TxwykGrg==} + proxy-from-env@1.1.0: resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} @@ -1079,6 +1091,9 @@ packages: simple-get@3.1.1: resolution: {integrity: sha512-CQ5LTKGfCpvE1K0n2us+kuMPbk/q0EKl82s4aheV9oXjFEz6W/Y7oQFVJuU6QG77hRT4Ghb5RURteF5vnWjupA==} + smoothscroll@0.4.0: + resolution: {integrity: sha512-sggQ3U2Un38b3+q/j1P4Y4fCboCtoUIaBYoge+Lb6Xg1H8RTIif/hugVr+ErMtIDpvBbhQfTjtiTeYAfbw1ZGQ==} + source-map-js@1.2.0: resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} engines: {node: '>=0.10.0'} @@ -1793,6 +1808,12 @@ snapshots: normalize-path: 3.0.0 picomatch: 2.3.1 + aplayer@1.10.1: + dependencies: + balloon-css: 0.5.2 + promise-polyfill: 7.1.0 + smoothscroll: 0.4.0 + aproba@2.0.0: optional: true @@ -1818,6 +1839,8 @@ snapshots: balanced-match@1.0.2: {} + balloon-css@0.5.2: {} + binary-extensions@2.3.0: {} brace-expansion@1.1.11: @@ -2271,6 +2294,8 @@ snapshots: picocolors: 1.0.1 source-map-js: 1.2.0 + promise-polyfill@7.1.0: {} + proxy-from-env@1.1.0: {} punycode.js@2.3.1: {} @@ -2347,6 +2372,8 @@ snapshots: simple-concat: 1.0.1 optional: true + smoothscroll@0.4.0: {} + source-map-js@1.2.0: {} string-width@4.2.3: diff --git a/src/plugins/miaoMusicPlayer/export.ts b/src/plugins/miaoMusicPlayer/export.ts new file mode 100644 index 0000000..d370124 --- /dev/null +++ b/src/plugins/miaoMusicPlayer/export.ts @@ -0,0 +1,33 @@ +import { registerComponentOption } from '@/class/PluginCenter' +import { PluginExportType } from '@/types/type' +import Disc from '@vicons/ionicons5/es/Disc' + + +const pluginConfig: registerComponentOption = { + key: 'miaoMusicPlayer', + name: '音乐', + icon: Disc, + getComponent: async () => + (await import('./miaoMusicPlayerDemo.vue')).default, + filter: (vDirs, vFiles) => { + if (vDirs.length !== 0) { + return false + } + if (vFiles.length === 0) { + return false + } + for (let i of vFiles) { + for (let s of ['mp3']) { + if (i.name.endsWith(s)) { + return true + } + } + } + return vFiles[0].name.endsWith('?') + }, + disable: false +} + +export default pluginConfig + +export const type = PluginExportType.component \ No newline at end of file diff --git a/src/plugins/miaoMusicPlayer/miaoMusicPlayerDemo.vue b/src/plugins/miaoMusicPlayer/miaoMusicPlayerDemo.vue new file mode 100644 index 0000000..0b65b81 --- /dev/null +++ b/src/plugins/miaoMusicPlayer/miaoMusicPlayerDemo.vue @@ -0,0 +1,73 @@ + + + + + + \ No newline at end of file diff --git a/src/plugins/miaoPluginTemplate/template.vue b/src/plugins/miaoPluginTemplate/template.vue index 8f356af..7ddcd71 100644 --- a/src/plugins/miaoPluginTemplate/template.vue +++ b/src/plugins/miaoPluginTemplate/template.vue @@ -1,5 +1,5 @@