1.0.6 • Published 5 years ago

audio-controls v1.0.6

Weekly downloads
1,067
License
-
Repository
github
Last release
5 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

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago