I want the videos to switch to a different one every period of time or at end of the video: //jQuery is required to run this code
$( document ).ready(function() {

    scaleVideoContainer();

    initBannerVideoSize('.video-module .vid img');
    initBannerVideoSize('.video-module .filter');
    initBannerVideoSize('.video-module video');

    $(window).on('resize', function() {
        scaleVideoContainer();
        scaleBannerVideoSize('.video-module .vid img');
        scaleBannerVideoSize('.video-module .filter');
        scaleBannerVideoSize('.video-module video');
    });

});

function scaleVideoContainer() {

    var height = $(window).height() + 5;
    var unitHeight = parseInt(height) + 'px';
    $('.hero').css('height',unitHeight);

}

function initBannerVideoSize(element){

    $(element).each(function(){
        $(this).data('height', $(this).height());
        $(this).data('width', $(this).width());
    });

    scaleBannerVideoSize(element);

}

function scaleBannerVideoSize(element){

    var windowWidth = $(window).width(),
    windowHeight = $(window).height() + 5,
    videoWidth,
    videoHeight;

    console.log(windowHeight);

    $(element).each(function(){
        var videoAspectRatio = $(this).data('height')/$(this).data('width');

        $(this).width(windowWidth);

        if(windowWidth < 1000){
            videoHeight = windowHeight;
            videoWidth = videoHeight / videoAspectRatio;
            $(this).css({'margin-top' : 0, 'margin-left' : -(videoWidth - windowWidth) / 2 + 'px'});

            $(this).width(videoWidth).height(videoHeight);
        }

        $('.hero .video-module video').addClass('fadeIn animated');

    });
}
<!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Your Website Title</title>

    <!-- Bootstrap Core CSS -->
    <link href="css/bootstrap.min.css" rel="stylesheet">

    <!-- Custom Fonts -->
    <link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href="http://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,700,300italic,400italic,700italic" rel="stylesheet" type="text/css">

    <!-- Custom CSS -->
    <link href="css/video.css" rel="stylesheet">
    <link href="css/main.css" rel="stylesheet">

</head>

<script>
  var videos = [“VuMeters.mp4”, “citySurvivalSimulator.mp4”, “anotherVideo.mp4”];
  var currentIndex = 0;
  var videoElement = document.getElementById(“myVideo”);

  function toggleVideo() {
    videoElement.src = videos[currentIndex];
    currentIndex++;
    if (currentIndex >= videos.length) {
      currentIndex = 0;
    }
  }

  setInterval(toggleVideo, 5000); // Change video every 5 seconds
</script>

<body>
    <!-- Header -->
    <section>
      <div class="hero">
    <div class="video-module">
        <div class="filter"></div>
        <video id=“myVideo” playsinline autoplay muted loop poster="cake.jpg" controls autoplay>
    <source src="VuMetersAv1.mp4" type="video/webm">
    Your browser does not support the video tag.
</video>

        <div class="vid hidden">
            <img src="" alt="">
        </div>
        <header class="header">
            <div class="text-middle">
                <div class="box"><h1>Strands Beach</h1>
                <h3>Life is always better at the beach.</h3>
                <br>
                <a href="" class="btn btn-dark btn-lg">Learn More</a></div>
            </div>
        </header>
    </div>
</div>
</section>
<section>
  <div class="centered-module">
  <h2>Content</h2>
  <p>The rest of your content goes here!</p>
</div>
</section>
<section>
  <div class="centered-module">
  <h2>Content</h2>
  <p>The rest of your content goes here!</p>
</div>
</section>
<section>
  <div class="centered-module">
  <h2>Content</h2>
  <p>The rest of your content goes here!</p>
</div>
</section>

<footer>
      <div class="container">
          <div class="row">
              <div class="col-lg-10 col-lg-offset-1 text-center">
                  <hr class="small">
                  <p class="text-muted">Copyright &copy; Strands Beach 2016</p>
              </div>
          </div>
      </div>
  </footer>
    <!-- jQuery -->
    <script src="js/jquery.js"></script>

    <!-- Bootstrap Core JavaScript -->
    <script src="js/bootstrap.min.js"></script>

    <!-- Custom JavaScript -->
    <script src="js/video_background.js"></script>


</body>

</html>