I Want To Stop/skip 30 Seconds On Audio In Html
I have an audio file in html. I want 4 buttons there: one for play,one for pause,one for stop,one for 30 seconds skip. Pause/Play works. The other 2 don't. I spent 2 hours trying a
Solution 1:
You did not have an audio variable. You need to grab the player and make the changes directly to the player. You also need to pause() on stopsong() or it will go back to the beginning but continue to play.
function stopsong() {
var player = document.getElementById('Player');
player.pause();
player.currentTime = 0;/**tried also with audio.currentTime here. Didn't worked **/
}
function forwardAudio() {
var player = document.getElementById('Player');
player.currentTime += 30.0; /**tried also with audio.currentTime here. Didn't worked **/
}
Post a Comment for "I Want To Stop/skip 30 Seconds On Audio In Html"