js stop youtube video code example
Example 1: stop video javascript
<video id="video">
<source src="movie.mp4" type="video/mp4">
</video>
<script>
const video = document.querySelector("#video");
video.pause();
video.currentTime = 0;
</script>
Example 2: stop a video jquery
$('#playButton').click(function(event){
$('#theVideo').get(0).play();
setTimeout(function(){
$('#theVideo').get(0).pause();
$('#theVideo').get(0).currentTime = 0;
}, 7000);
});