X-MUSIC

Set background music and playback controls.

Installation

  • install via npm or yarn:
npm install x-music --save

Getting off

  • Reference using ES6:
import XMusic from 'x-music';

// Use webpack please import to introduce static resources
Import src from '***';
import playImg from '***';
import pauseImg from '***';

const xMusic = new XMusic({ src, playImg, pauseImg });
xMusic.init();

This project is packaged in rollup using UMD format, supporting the introduction of AMD, CommonJS, and script tags. [Download Source] (https://github.com/codexu/x-music/tree/master/dist)

Parameters

If you are packaging with webpack, use import to load the static resource:

src*

none <String>

Music path

playImg*

none <String>

Play button image path

pauseImg*

none <String>

Pause button image path

width

none <String>

Button image width (px)

height

none <String>

Button picture height (px)