Skip to content

Latest commit

 

History

History
31 lines (24 loc) · 714 Bytes

README.md

File metadata and controls

31 lines (24 loc) · 714 Bytes

amr-player play remote amr format audio with JavaScript

inpired by https://github.com/yxl/opencore-amr-js

-- AmrPlayer --

params:

amr_url
download_success_cb (optional)
download_progress_cb (optional)

props:

bool canPlay
bool isPlaying

methods:

play()
pause()
toggle() // play() when paused or pause() when playing
endWith(callback) // optional, fire callback with ended event

usage: <script src="xxx/amrnb.js"></script> <script src="xxx/amrplayer.js"></script>

var player = new AmrPlayer('http://xxx.com/xxx.amr');
player.endWith(function(){ console.log( xxx ) });
player.play();
// or player.pause();
// or player.toggle();