0

I am building a simple page consisting of a table containing links to videos. The action I'm trying to duplicate is essentially how the menu system works on a DVD. I want to be able to launch a video, and when the video finishes, I want the menu (our original launching page) to be displayed again without having to hit the browser's "back" button.

The code below demonstrates how each video is launched. Using this code, when a video finishes playing, we are left at the blank screen where the video ends.

<td align="center"><strong><span style="font-family: Arial; font-size:24px;">
<a href="yakima.mp4">Yakima Video</a></span></strong></td>
</tr>
j08691
  • 204,283
  • 31
  • 260
  • 272
  • Does this answer your question? [How can I redirect to a URL after a HTML video has ended?](https://stackoverflow.com/questions/20008778/how-can-i-redirect-to-a-url-after-a-html-video-has-ended) – Eduard Mar 23 '20 at 17:02
  • Thank you for your quick reply. Before I posted this question, I searched this forum and others, and I actually found this thread. Unfortunately, my html experience is meager. Twenty years ago, I wrote simple web pages using nothing but Notepad. Now I'm trying to re-acquaint myself with basic html, as well as stumbling across 20 years of advances, trying to write a simple page for my grandson to watch family videos. So, I've tried plugging the code you referred to into my table, and so far, I can't make it work. If you can think of anything else that might help, I'm all ears. – ricknewsom Mar 23 '20 at 17:42
  • Count me in. Get in touch as soon as I have the solution – Eduard Mar 24 '20 at 11:06

1 Answers1

0

So, here I am again. I have now tried to set up a forwarding myself. I believe here is a way for you to advance your project. Greetings to your grandson.

This is the code i used:

<!DOCTYPE html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1">

</head>
<body>



        <video id="video1" controls="controls">
            <source src="sample.mp4" type="video/mp4">
            Your browser does not support HTML5 video.
        </video>


        <script>
            video = document.getElementById('video1');
            video.addEventListener('ended',function() {   
            window.location.href = 'https://www.youtube.com/';})
        </script>
</body> 

Eduard
  • 141
  • 7