0.4.3 • Published 9 years ago
voop v0.4.3
Voop
Voop • easy web audio player
for fast use look at index.html
How to start?
var music = Voop('url/to/music.mp3');
music.play(); //to play
music.pause(); //to pause
music.stop(); //to stop
More options:
var music = Voop('url/to/music.mp3', {
"autoplay": false,
"autobuffer": false,
"preload": false,
"loop": false,
"volume": 0.5, //1 - full volume, 0 - mute
//2 events
"onPlaying": function(){
console.log(this.position); //shows the current position
/*
"this" here is current Voop object, with all standart options:
this.play()
this.pause()
this.stop()
this.volume
this.position
this.src
this.muted
this.duration
this.playing
*/
},
"onEnd": function(){
console.log('end'); //shows 'end' on audio ends
}
});
"then" promise:
var music = Voop('url/to/music.mp3');
music.play().then(function(){
this.position = 50; // change the posiotion of the audio to 50%
this.play(); //begin playing again ;)
}, 500);
//where 500 - msec penalty, not required