HTML 5 Video

I want to play 2 or more videos in succession on an HTML 5 page. When the first one ends, I want to start the 2nd one within 1 or 2 seconds. Etc.

Basically, I want to take the attached HTML and make it play several.

Note for those of you who might have looked at my other questions on this subject with the 344MB video, we are going to break that into pieces.

Can someone point me to code that will do this? I'm familiar with javascript timers, etc.

Richard KortsAsked:
Who is Participating?
Roopesh ReddyConnect With a Mentor IT AnalystCommented:


So, i got this link for you -

Well explained for playing multiple files with HTML 5 Video tag!

Hope it helps u...
Hello dear Author,

with video js, an html5 framework for consistent html5 video playback in all browsers you have the possibility to add event listeners to your video.

For example, when your video has been watched to the fullest, it will trigger a function which pulls in the next video.

Reference to the api of video js on github which is very well explained and easy to learn.

In your case the api call would be like this:
var myFunc = function(){
  var myPlayer = this;
  // Here you pull in the next video either with jquery dom insertion or by changing the src attribute of the html5 video tag.
myPlayer.addEvent("ended", myFunc);

Open in new window

I've made wonderful experience with the framework. It is developed by a company, zencoder, which delivers the best video experience to millions of people today. So it is a reliable framework.

Best regards,
Manoj PatilSr. Software EngineerCommented:
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to and use offer code ‘EXPERTS’ to get 10% off your first purchase.

why not using a plugin?

It support playlist, you can customize the template (or don't have any) and more...
Roopesh ReddyIT AnalystCommented:

Take a look at the available HTML5 Video players and compared here -

Choose the best one you like!

My preference is Video.js -

This looks interesting as well -

Hope it helps u...
Richard KortsAuthor Commented:
To all,

I've tried to use and play ONE video ONCE no controls, autoplay.

It DOESN'T work!!

It loads the page & does NOTHING. I can't find ANY documentation that tells what properties / methods there are. I need the ability for the user to pause / play. The method pause is not supported. etc. The docs page is VERY limited.

Don't know why everybody is so hot on that.

I need something that WORKS!!!

<!doctype html>
<html  lang="en">
<meta charset="utf-8">
<meta content="IE=edge,chrome=1" />

<title>Play Video</title>
<link href="" rel="stylesheet">
<script src=""></script>
<script language="JavaScript" type="text/javascript">
      var myVideo = document.getElementById("video1");
      ac = "";
      function do_init() {
            window.setTimeout("see_if_done()", 1000);
      function see_if_done() {
            var myVideo = document.getElementById("video1");
                  if (myVideo.ended) {
                        code = "WATER";
                        alert("Enter your code of " + code + " now and click Go.");
                  } else {
                        window.setTimeout("see_if_done()", 1000);
            return true;
      function chk_vals() {
            if (ac != "p") {
                  if ( == "") {
                        alert("Please enter your code.");
                        return false;
                  return true;            
            } else {
                  return false;
function vid_play_pause() {
      var myVideo = document.getElementById("video1");
  if (myVideo.paused) {;
  } else {
  return true;
<body style="font-family: Arial, Helvetica; font-size: 12pt;" onLoad="do_init();">
      <table width="800" cellpadding="4">
                  <td><img src="images/spacer.gif" width="100" height="5">
                  <td><img src="images/logo.jpg"></td>
                  <td><img src="images/header.jpg"></td>
<form method="POST" name="fr" action="thank_you.php" onSubmit="return chk_vals();">
<div style="text-align:center">
<video id="video1" class="video-js vjs-default-skin" autoplay
  preload="auto" width="800" height="600"
      <source src="Aquascape Webinar.mp4" type="video/mp4">
    <source src="Aquascape Webinar.ogg" type="video/ogg"></video>
  <br> <button onclick="ac='p'; vid_play_pause();">Play/Pause</button>
  Enter Your Code<br>
  <input type="text" name="scode" size="20" id="scode"><br><br>
  <input type="submit" value="Validate Attendance" id="subgo" onMousedown="ac='';">

Roopesh ReddyIT AnalystCommented:

Check this link -

This article explains clearly what you wish - Playing multiple files!

Hope it helps u...
Richard KortsAuthor Commented:

I looked at that & I have NO CLUE.

Looks like TOTAL nonsense to me, I have NO IDEA how to apply that.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.