I tested with an other video because i can't access yours.
The code below is to run a video after another :
<!DOCTYPE html>
<html>
<body>
<p>Press play and wait for the video to end.</p>
<video autoplay preload muted playsinline id="bgvid" width="320" height="176" controls>
<source src="mov_bbb.mp4" type="video/mp4">
<source src="mov_bbb.ogg" type="video/ogg">
Your browser does not support HTML5 video.
</video>
<br/>
<video muted playsinline id="akiratrailer" controls>
<source src="mov_bbb.mp4" type="video/mp4">
<source src="mov_bbb.ogg" type="video/ogg">
Your browser does not support HTML5 video.
</video>
<script>
var vid = document.getElementById("bgvid");
vid.onended = function() {
document.getElementById('akiratrailer').play();
};
</script>
<p>Videos courtesy of <a href="https://www.bigbuckbunny.org/" target="_blank">Big Buck Bunny</a>.</p>
</body>
</html>
It run if you try there :
https://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_av_event_ended2
just copy my code, go on the link, delete everything, paste my code on the link
and run it to see the result.
Furthermore,
if you want to switch video1 and video2 you can do that :
<!DOCTYPE html>
<html>
<body>
<p>Press play and wait for the video to end.</p>
<video autoplay preload muted playsinline id="bgvid" width="320" height="176" controls>
<source src="mov_bbb.mp4" type="video/mp4">
<source src="mov_bbb.ogg" type="video/ogg">
Your browser does not support HTML5 video.
</video>
<br/>
<video muted playsinline id="akiratrailer" controls style="display:none">
<source src="mov_bbb.mp4" type="video/mp4">
<source src="mov_bbb.ogg" type="video/ogg">
Your browser does not support HTML5 video.
</video>
<script>
var vid = document.getElementById("bgvid");
var vid2 = document.getElementById('akiratrailer');
vid.onended = function() {
vid.style.display = "none";
vid2.style.display = "block";
vid2.play();
};
</script>
<p>Videos courtesy of <a href="https://www.bigbuckbunny.org/" target="_blank">Big Buck Bunny</a>.</p>
</body>
</html>
But i have just one video to run the test, so it seems it is the same video witch loop. But it's not it is two distinct videos. You'll have to try with yours to see.
And if you want to show the second video at the end of the first above the first witch is in background you can do :
<!DOCTYPE html>
<html>
<body>
<p>Press play and wait for the video to end.</p>
<video autoplay preload muted playsinline id="bgvid" width="320" height="176" controls>
<source src="mov_bbb.mp4" type="video/mp4">
<source src="mov_bbb.ogg" type="video/ogg">
Your browser does not support HTML5 video.
</video>
<br/>
<video muted playsinline id="akiratrailer" controls style="display:none">
<source src="mov_bbb.mp4" type="video/mp4">
<source src="mov_bbb.ogg" type="video/ogg">
Your browser does not support HTML5 video.
</video>
<script>
var vid = document.getElementById("bgvid");
var vid2 = document.getElementById('akiratrailer');
vid.onended = function() {
//vid.style.display = "none";
vid2.style.display = "block";
vid2.play();
};
</script>
<p>Videos courtesy of <a href="https://www.bigbuckbunny.org/" target="_blank">Big Buck Bunny</a>.</p>
</body>
</html>