nuxt-musicfyplayer 2.0.3 → 2.1.1

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 CHANGED
@@ -69,6 +69,7 @@ Define your configuration options with the `defineMusicfyPlayer` composable.
69
69
  |------------|----------------------------------|---------------|
70
70
  | `provider` | Provider of the audio source. | `local` |
71
71
  | `type` | Content-type fo the audio source | `audio/mpeg` |
72
+ | `preload` | Preload the audio source | `auto` |
72
73
  | [`...`](#supported-audio-providers) | Selected audio provider properties ||
73
74
 
74
75
  ### Supported audio providers
@@ -114,6 +115,7 @@ Use the emoji property to render an emoji by character.
114
115
  const config = defineMusicfyPlayer({
115
116
  audio: {
116
117
  provider: "dropbox",
118
+ preload: "none",
117
119
  id: "soep3xvq8aee4eh6hcj4r",
118
120
  rlkey: "g7sqo9y5zl3f69oxftzo5auc5"
119
121
  },
package/dist/module.json CHANGED
@@ -4,9 +4,9 @@
4
4
  "compatibility": {
5
5
  "nuxt": ">=3.0.0"
6
6
  },
7
- "version": "2.0.3",
7
+ "version": "2.1.1",
8
8
  "builder": {
9
- "@nuxt/module-builder": "0.8.3",
9
+ "@nuxt/module-builder": "0.8.4",
10
10
  "unbuild": "2.0.0"
11
11
  }
12
12
  }
@@ -68,7 +68,7 @@ onMounted(async () => {
68
68
  <div class="musicfyplayer" :class="{ [`${config.colorClass}`]: config.colorClass }" :style="{ ...size, backgroundColor }">
69
69
  <div class="mp__box">
70
70
  <div class="mp__controls">
71
- <audio ref="audio" class="mp__music">
71
+ <audio ref="audio" class="mp__music" :preload="config.audioPreload">
72
72
  <source :src="config.audioSrc" :type="config.audioType">
73
73
  </audio>
74
74
  </div>
@@ -21,6 +21,7 @@ export const defineMusicfyPlayer = (config) => {
21
21
  imageAlt: config.image.alt || "Musicfy Player",
22
22
  audioType: config.audio.type || "audio/mpeg",
23
23
  audioSrc: audioSrc.value,
24
+ audioPreload: config.audio.preload || "auto",
24
25
  colorClass: config.color?.class || "musicfyplayer-color",
25
26
  colorDetect: config.color?.detect || false
26
27
  };
@@ -21,6 +21,11 @@ export interface MusicfyPlayerDefinition {
21
21
  * @default 'audio/mpeg'
22
22
  */
23
23
  type?: string
24
+ /**
25
+ * Specifies if and how the audio file should be loaded when the page loads
26
+ * @default 'auto'
27
+ */
28
+ preload?: 'auto' | 'metadata' | 'none'
24
29
  } & (LocalAudio | DropboxAudio)
25
30
  /**
26
31
  * Color configuration
@@ -62,6 +67,7 @@ export interface MusicfyPlayerConfig {
62
67
  imageAlt: string
63
68
  audioType: string
64
69
  audioSrc: string
70
+ audioPreload: MusicfyPlayerDefinition['audio']['preload']
65
71
  colorClass: string
66
72
  colorDetect: boolean
67
73
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-musicfyplayer",
3
- "version": "2.0.3",
3
+ "version": "2.1.1",
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",
@@ -44,22 +44,22 @@
44
44
  "test:watch": "vitest watch"
45
45
  },
46
46
  "dependencies": {
47
- "@nuxt/kit": "^3.13.0",
48
- "colorthief": "^2.4.0",
47
+ "@nuxt/kit": "^3.13.2",
48
+ "colorthief": "2.4.0",
49
49
  "mediaelement": "^7.0.5"
50
50
  },
51
51
  "devDependencies": {
52
- "@nuxt/devtools": "^1.4.1",
53
- "@nuxt/eslint-config": "^0.5.4",
54
- "@nuxt/module-builder": "^0.8.3",
55
- "@nuxt/schema": "^3.13.0",
56
- "@nuxt/test-utils": "^3.14.1",
57
- "@types/node": "^22.5.1",
58
- "changelogen": "^0.5.5",
59
- "eslint": "^9.9.1",
60
- "nuxt": "^3.13.0",
61
- "vitest": "^2.0.5",
62
- "vue-tsc": "^2.1.2"
52
+ "@nuxt/devtools": "^1.6.0",
53
+ "@nuxt/eslint-config": "^0.5.7",
54
+ "@nuxt/module-builder": "^0.8.4",
55
+ "@nuxt/schema": "^3.13.2",
56
+ "@nuxt/test-utils": "^3.14.3",
57
+ "@types/node": "^22.7.5",
58
+ "changelogen": "^0.5.7",
59
+ "eslint": "^9.12.0",
60
+ "nuxt": "^3.13.2",
61
+ "vitest": "^2.1.2",
62
+ "vue-tsc": "^2.1.6"
63
63
  },
64
64
  "changelog": {
65
65
  "repo": {
@@ -68,5 +68,5 @@
68
68
  "domain": "github.com"
69
69
  }
70
70
  },
71
- "packageManager": "pnpm@9.9.0"
71
+ "packageManager": "pnpm@9.12.1"
72
72
  }