next-audio-manager
Audio manager.
installation
npm install -S @jswork/next-audio-manager
apis
api | params | description |
---|---|---|
create | - | Create one/multiple instance. |
method | - | Call context method. |
property | - | Call context property. |
usage
import NxAudioManager from '@jswork/next-audio-manager';
// ======= multiple =======
NxAudioManager.create([
{ key: 'k1', src: 'https://file-examples.com/wp-content/uploads/2017/11/file_example_MP3_700KB.mp3' },
{ key: 'k2', src: 'https://kolber.github.io/audiojs/demos/mp3/juicy.mp3' }
]);
// stop all audios:
NxAudioManager.method('play');
// ======= single =======
const audio = NxAudioManager.create({
standalone: true,
src: 'https://file-examples.com/wp-content/uploads/2017/11/file_example_MP3_700KB.mp3'
});
audio.method('play');
license
Code released under the MIT license.