android - Apache Cordova - Media Plugin play/stop button toggle -
i creating app android using cordova plugin media. how creating button switch play/stop using function below?
function playaudio(src) { my_media = new media(src, onsuccess, onerror); my_media.play();} function pauseaudio() { if (my_media) { my_media.pause();}} function stopaudio() { if (my_media) { my_media.stop();}} function onsuccess() { console.log("playaudio():audio success");} function onerror(error) { alert('code: ' + error.code + '\n' + 'message: ' + error.message + '\n');}
Comments
Post a Comment