nuxt-musicfyplayer 2.1.2 → 2.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/module.d.mts +2 -1
- package/dist/module.json +3 -3
- package/dist/runtime/components/MusicfyPlayer.vue +52 -62
- package/dist/runtime/components/MusicfyPlayer.vue.d.ts +22 -0
- package/dist/runtime/composables/musicfyplayer.d.ts +2 -2
- package/dist/types.d.mts +3 -1
- package/package.json +19 -28
- package/dist/module.cjs +0 -5
- package/dist/module.d.ts +0 -7
- package/dist/types.d.ts +0 -1
package/README.md
CHANGED
@@ -49,7 +49,7 @@ In the project, use the component `<MusicfyPlayer :config="" />`, where `config`
|
|
49
49
|
|
50
50
|
| Property | Description | Default value |
|
51
51
|
|---------------------------------------|--------------------------|---------------|
|
52
|
-
| [`config`](#musicfyplayer-
|
52
|
+
| [`config`](#musicfyplayer-composable) | MusicfyPlayer composable | |
|
53
53
|
| `width` | Music player width | `100%` |
|
54
54
|
| `height` | Music player height | `450px` |
|
55
55
|
|
@@ -120,7 +120,7 @@ const config = useMusicfyPlayer({
|
|
120
120
|
rlkey: "g7sqo9y5zl3f69oxftzo5auc5"
|
121
121
|
},
|
122
122
|
image: {
|
123
|
-
src: "https://dimatis.
|
123
|
+
src: "https://dimatis.music/images/reminiscences.jpg",
|
124
124
|
alt: "Dimatis - Reminiscences"
|
125
125
|
},
|
126
126
|
color: {
|
package/dist/module.d.mts
CHANGED
package/dist/module.json
CHANGED
@@ -1,62 +1,52 @@
|
|
1
|
-
<script setup
|
2
|
-
import ColorThief from
|
3
|
-
import
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
const
|
29
|
-
const
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
alwaysShowControls: true,
|
51
|
-
timeAndDurationSeparator: '<span></span>',
|
52
|
-
iPadUseNativeControls: false,
|
53
|
-
iPhoneUseNativeControls: false,
|
54
|
-
AndroidUseNativeControls: false,
|
55
|
-
})
|
56
|
-
})
|
57
|
-
</script>
|
58
|
-
|
59
|
-
<template>
|
1
|
+
<script setup>
|
2
|
+
import ColorThief from "colorthief";
|
3
|
+
import { onMounted, ref, useTemplateRef } from "#imports";
|
4
|
+
const props = defineProps({
|
5
|
+
config: {
|
6
|
+
type: Object,
|
7
|
+
required: true
|
8
|
+
},
|
9
|
+
width: {
|
10
|
+
type: String,
|
11
|
+
required: false,
|
12
|
+
default: "100%"
|
13
|
+
},
|
14
|
+
height: {
|
15
|
+
type: String,
|
16
|
+
required: false,
|
17
|
+
default: "450px"
|
18
|
+
}
|
19
|
+
});
|
20
|
+
const audio = useTemplateRef("audio");
|
21
|
+
const size = ref({ width: props.width, height: props.height });
|
22
|
+
const backgroundColor = ref();
|
23
|
+
if (import.meta.client && props.config.colorDetect) {
|
24
|
+
const img = new Image();
|
25
|
+
img.crossOrigin = "Anonymous";
|
26
|
+
img.src = props.config.imageSrc;
|
27
|
+
img.onload = () => {
|
28
|
+
const colorThief = new ColorThief();
|
29
|
+
const color = colorThief.getColor(img);
|
30
|
+
backgroundColor.value = color ? `rgb(${color[0]}, ${color[1]}, ${color[2]})` : void 0;
|
31
|
+
};
|
32
|
+
}
|
33
|
+
onMounted(async () => {
|
34
|
+
if (!audio.value) return;
|
35
|
+
const { mediaElementPlayer } = await import("./../utils/mediaelement");
|
36
|
+
mediaElementPlayer(audio.value, {
|
37
|
+
iconSprite: "",
|
38
|
+
audioHeight: 40,
|
39
|
+
features: ["playpause", "current", "duration", "progress", "volume", "tracks", "fullscreen"],
|
40
|
+
alwaysShowControls: true,
|
41
|
+
timeAndDurationSeparator: "<span></span>",
|
42
|
+
iPadUseNativeControls: false,
|
43
|
+
iPhoneUseNativeControls: false,
|
44
|
+
AndroidUseNativeControls: false
|
45
|
+
});
|
46
|
+
});
|
47
|
+
</script>
|
48
|
+
|
49
|
+
<template>
|
60
50
|
<div class="musicfyplayer" :class="{ [`${config.colorClass}`]: config.colorClass }" :style="{ ...size, backgroundColor }">
|
61
51
|
<div class="mp__box">
|
62
52
|
<div class="mp__controls">
|
@@ -75,8 +65,8 @@ onMounted(async () => {
|
|
75
65
|
</div>
|
76
66
|
</div>
|
77
67
|
</div>
|
78
|
-
</template>
|
79
|
-
|
68
|
+
</template>
|
69
|
+
|
80
70
|
<style>
|
81
71
|
@import "./../assets/css/musicfyplayer.css";
|
82
|
-
</style>
|
72
|
+
</style>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import type { MusicfyPlayerConfig } from './../types/musicfyplayer.js';
|
2
|
+
type __VLS_Props = {
|
3
|
+
/**
|
4
|
+
* The configuration of the player
|
5
|
+
*/
|
6
|
+
config: MusicfyPlayerConfig;
|
7
|
+
/**
|
8
|
+
* The width and height of the player
|
9
|
+
* @default '100%'
|
10
|
+
*/
|
11
|
+
width?: string;
|
12
|
+
/**
|
13
|
+
* The height of the player
|
14
|
+
* @default '450px'
|
15
|
+
*/
|
16
|
+
height?: string;
|
17
|
+
};
|
18
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
19
|
+
width: string;
|
20
|
+
height: string;
|
21
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
22
|
+
export default _default;
|
@@ -5,5 +5,5 @@ import type { MusicfyPlayerConfig, MusicfyPlayerComposableConfig } from './../ty
|
|
5
5
|
* @param config - Musicfy Player composable configuration
|
6
6
|
* @returns Musicfy Player configuration
|
7
7
|
*/
|
8
|
-
export declare const useMusicfyPlayer: <T extends keyof Providers>(config: MusicfyPlayerComposableConfig<T>) => MusicfyPlayerConfig;
|
9
|
-
export declare const defineMusicfyPlayer: <T extends keyof Providers>(config: MusicfyPlayerComposableConfig<T>) => MusicfyPlayerConfig;
|
8
|
+
export declare const useMusicfyPlayer: <T extends keyof Providers = "local">(config: MusicfyPlayerComposableConfig<T>) => MusicfyPlayerConfig;
|
9
|
+
export declare const defineMusicfyPlayer: <T extends keyof Providers = "local">(config: MusicfyPlayerComposableConfig<T>) => MusicfyPlayerConfig;
|
package/dist/types.d.mts
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "nuxt-musicfyplayer",
|
3
|
-
"version": "2.1.
|
3
|
+
"version": "2.1.3",
|
4
4
|
"description": "Embed a simple and beautiful HTML music player from local or hosted audio on your website using MediaElement.js and ColorThief.js",
|
5
5
|
"keywords": [
|
6
6
|
"nuxt",
|
@@ -16,19 +16,17 @@
|
|
16
16
|
"author": {
|
17
17
|
"name": "Yizack Rangel",
|
18
18
|
"email": "yizackr@gmail.com",
|
19
|
-
"url": "https://yizack.com
|
19
|
+
"url": "https://yizack.com"
|
20
20
|
},
|
21
21
|
"license": "MIT",
|
22
22
|
"type": "module",
|
23
23
|
"exports": {
|
24
24
|
".": {
|
25
|
-
"types": "./dist/types.d.
|
26
|
-
"import": "./dist/module.mjs"
|
27
|
-
"require": "./dist/module.cjs"
|
25
|
+
"types": "./dist/types.d.mts",
|
26
|
+
"import": "./dist/module.mjs"
|
28
27
|
}
|
29
28
|
},
|
30
|
-
"main": "./dist/module.
|
31
|
-
"types": "./dist/types.d.ts",
|
29
|
+
"main": "./dist/module.mjs",
|
32
30
|
"files": [
|
33
31
|
"dist"
|
34
32
|
],
|
@@ -45,29 +43,22 @@
|
|
45
43
|
"test:watch": "vitest watch"
|
46
44
|
},
|
47
45
|
"dependencies": {
|
48
|
-
"@nuxt/kit": "^3.
|
46
|
+
"@nuxt/kit": "^3.16.2",
|
49
47
|
"colorthief": "2.4.0",
|
50
48
|
"mediaelement": "^7.0.7"
|
51
49
|
},
|
52
50
|
"devDependencies": {
|
53
|
-
"@nuxt/devtools": "^2.
|
54
|
-
"@nuxt/eslint-config": "^1.0
|
55
|
-
"@nuxt/module-builder": "^0.
|
56
|
-
"@nuxt/schema": "^3.
|
57
|
-
"@nuxt/test-utils": "^3.
|
58
|
-
"@types/node": "^22.
|
59
|
-
"changelogen": "^0.
|
60
|
-
"eslint": "^9.
|
61
|
-
"nuxt": "^3.
|
62
|
-
"vitest": "^3.
|
63
|
-
"vue-tsc": "^2.2.
|
51
|
+
"@nuxt/devtools": "^2.3.2",
|
52
|
+
"@nuxt/eslint-config": "^1.3.0",
|
53
|
+
"@nuxt/module-builder": "^1.0.0",
|
54
|
+
"@nuxt/schema": "^3.16.2",
|
55
|
+
"@nuxt/test-utils": "^3.17.2",
|
56
|
+
"@types/node": "^22.14.0",
|
57
|
+
"changelogen": "^0.6.1",
|
58
|
+
"eslint": "^9.24.0",
|
59
|
+
"nuxt": "^3.16.2",
|
60
|
+
"vitest": "^3.1.1",
|
61
|
+
"vue-tsc": "^2.2.8"
|
64
62
|
},
|
65
|
-
"
|
66
|
-
|
67
|
-
"repo": "Yizack/nuxt-musicfyplayer",
|
68
|
-
"provider": "github",
|
69
|
-
"domain": "github.com"
|
70
|
-
}
|
71
|
-
},
|
72
|
-
"packageManager": "pnpm@10.2.1"
|
73
|
-
}
|
63
|
+
"packageManager": "pnpm@10.7.1"
|
64
|
+
}
|
package/dist/module.cjs
DELETED
package/dist/module.d.ts
DELETED
package/dist/types.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export { type ModuleOptions, default } from './module'
|