<video onended="prtlog('play again?');">
When the video ends, "play again" will show under the video.
How can I change/add code to my program that then when user clicks "play again", the video will play again?
<video onended="prtlog('play again?');">
When the video ends, "play again" will show under the video.
How can I change/add code to my program that then when user clicks "play again", the video will play again?
If you want to add a replay button to your video just check when curVid.currentTime == curVid.duration and have the button display. The code for the button is below. You can display your button whenever you'd like and it will always restart your video.
var curVid = getElementById('videoClip');
$(document).on('click','#replayBtn',function(){
curVid.pause();
curVid.currentTime = '0';
curVid.play();
});
<video loop>
The html attribute "loop" will replay your video automatically.
© 2022 - 2024 — McMap. All rights reserved.