1.0.6 • Published 6 years ago

audio-controls v1.0.6

Weekly downloads
1,067
License
-
Repository
github
Last release
6 years ago

Audio Controls

Connect events (play, pause, previous, next) from PlayQueue or the Audio element to HTML elements.

Install

npm install audio-controls

Usage

  import {AudioControls} from 'audio-controls';
    
  const audioControls = new AudioControls({
    'playQueue': playQueue, // optional if audio is provided
    'audio': audioObject, // optional if playQueue is provided
    'playPause': '#control-play-pause',
    'previous': '#control-previous',
    'next': '#control-next'
  });

Example HTML

  <div class="controls">
    <div class="control previous" id="control-previous"></div>
    <div class="control play-pause" id="control-play-pause"></div>
    <div class="control next" id="control-next"></div>
  </div>

Build

Watch JS and LESS files

npm run dev

Rollup JS and LESS files

npm run build

Run the example To run it, you'll need a webserver. I recommend https://www.npmjs.com/package/http-server. After installing it run http-server and open a browser to http://localhost:8080/example/.

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago