- This topic is empty.
Viewing 1 post (of 1 total)
Viewing 1 post (of 1 total)
- The forum ‘JavaScript’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › JavaScript › Do not play track if manually paused after closing video.
I have an mp3 player with the following function as “play”:
this.play = function(e) {
if (n.isStopped_bl) {
n.isPlaying_bl = false;
n.hasError_bl = false;
n.allowScrubing_bl = false;
n.isStopped_bl = false;
n.setupAudio();
n.audio_el.src = n.sourcePath_str;
n.play()
} else if (!n.audio_el.ended || e) {
try {
n.isPlaying_bl = true;
n.hasPlayedOnce_bl = true;
n.audio_el.play();
if (FWDUtils.isIE)
n.dispatchEvent(t.PLAY)
} catch (r) {}
}
};
Then for the pause function I have this code:
this.pause = function() {
if (n == null)
return;
if (n.audio_el == null)
return;
if (!n.audio_el.ended) {
try {
n.audio_el.pause();
n.isPlaying_bl = false;
if (FWDUtils.isIE)
n.dispatchEvent(t.PAUSE)
} catch (e) {}
}
};
I have a video gallery and when I open a video the player automatically pauses and when I close this video, the music resumes. Now my question is how do I impede the music playing if the music is manually paused before opening a video?