javascript video after play

Solutions on MaxInterview for javascript video after play by the best coders in the world

showing results for - "javascript video after play"
Giorgia
31 Jan 2020
1<script type="text/javascript">
2// Do not name the function "play()"
3function playVideo(){
4    var video = document.getElementById('video');
5    video.play();
6    video.addEventListener('ended',function(){
7        window.location = 'http://www.google.com';
8    });
9}
10</script>
11<video controls id="video" width="770" height="882" onclick="playVideo()">
12    <source src="video/Motion.mp4" type="video/mp4" />
13</video>
14