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

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -