Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
stopPlayingAudio:function(successCallback, errorCallback, args) {
var id = args[0];
window.clearTimeout(audioObjects[id].timer);
audioObjects[id].pause();
if (audioObjects[id].currentTime !== 0)
audioObjects[id].currentTime = 0;
console.log("media::stopPlayingAudio() - MEDIA_STATE -> MEDIA_STOPPED");
Media.onStatus(id, Media.MEDIA_STATE, Media.MEDIA_STOPPED);
audioObjects[id].removeEventListener('canplay', audioObjects[id].onCanPlayCB);
audioObjects[id].removeEventListener('ended', audioObjects[id].onEndedCB);
audioObjects[id].removeEventListener('timeupdate', audioObjects[id].onTimeUpdateCB);
audioObjects[id].removeEventListener('durationchange', audioObjects[id].onDurationChangeCB);
audioObjects[id].removeEventListener('playing', audioObjects[id].onPlayingCB);
audioObjects[id].removeEventListener('play', audioObjects[id].onPlayCB);
audioObjects[id].removeEventListener('error', audioObjects[id].onErrorCB);
audioObjects[id].removeEventListener('error', audioObjects[id].onStalledCB);
},