nuxt-musicfyplayer 2.1.5 → 2.1.6

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
@@ -146,6 +146,7 @@ Check out the [🏀 Online playground](https://stackblitz.com/github/yizack/nuxt
146
146
 
147
147
  ## Credits
148
148
 
149
+ - Built based on [embeddable-music-player](https://github.com/Yizack/embeddable-music-player)
149
150
  - Detect average color with [fast-average-color](https://github.com/fast-average-color/fast-average-color)
150
151
  - Music player controls by [MediaElement.js](https://www.mediaelementjs.com/)
151
152
  - [Nuxt](https://github.com/nuxt/nuxt), the JavaScript framework for creating SSR Vue applications and its [Module Author Guide](https://nuxt.com/docs/guide/going-further/modules)
package/dist/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": ">=3.0.0"
6
6
  },
7
- "version": "2.1.5",
7
+ "version": "2.1.6",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.0",
10
10
  "unbuild": "3.5.0"
@@ -1,16 +1,6 @@
1
1
  import { FastAverageColor } from "fast-average-color";
2
2
  const fac = new FastAverageColor();
3
- export const getImageAverageColor = (src) => {
4
- return new Promise((resolve, reject) => {
5
- const img = new Image();
6
- img.crossOrigin = "Anonymous";
7
- img.src = src;
8
- img.onload = () => {
9
- const color = fac.getColor(img);
10
- resolve(color.rgb);
11
- };
12
- img.onerror = () => {
13
- reject(new Error(`Failed to load image: ${src}`));
14
- };
15
- });
3
+ export const getImageAverageColor = async (src) => {
4
+ const color = await fac.getColorAsync(src);
5
+ return color.rgb;
16
6
  };
@@ -1,3 +1,3 @@
1
- import 'mediaelement/build/mediaelement-and-player.js';
1
+ import 'mediaelement/build/mediaelement-and-player.min.js';
2
2
  import type { MediaElementPlayerOptions } from '../types/mediaelement.js';
3
3
  export declare const mediaElementPlayer: (element: HTMLAudioElement, options: MediaElementPlayerOptions) => void;
@@ -1,4 +1,4 @@
1
- import "mediaelement/build/mediaelement-and-player.js";
1
+ import "mediaelement/build/mediaelement-and-player.min.js";
2
2
  import { createError } from "h3";
3
3
  export const mediaElementPlayer = (element, options) => {
4
4
  const MediaElementPlayer = window.MediaElementPlayer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-musicfyplayer",
3
- "version": "2.1.5",
3
+ "version": "2.1.6",
4
4
  "description": "Embed a simple and beautiful HTML music player from local or hosted audio on your website using MediaElement.js and fast-average-color",
5
5
  "keywords": [
6
6
  "nuxt",