1
votes

I need to have a Vimeo Video play when the webpage loads, it is an example of our Community Channel and the page is not listed nor is there any audio. I am using a fullscreen loop script currently that when you go to the page had a spot for you to click to start the video... I need to change this. I have added the Script in question.

Ideally, I would like to keep the header just have it wait for 5 seconds then play the video without the need to click on anything.

$(document).ready(function(){
  // Initiate FitVid.js
  $(".video-container").fitVids();

  // Iframe/player variables
  var iframe = $('#video')[0];
  var player = $f(iframe);

  // Open on play
  $('.play').click(function(){
    $('.overlay').css('left', 0)
    $('.overlay').addClass('show')
    player.api("play");
  })

  // Closes on click outside
  $('.overlay').click(function(){
    $('.overlay').removeClass('show')
    setTimeout(function() {
      $('.overlay').css('left', '-100%')
    }, 300);
    player.api("pause");
  })
});

    <header>
  <div>
    <h1>Please Stand By. The Presentation is Loading</h1>
    <span class="play"></span>  <<< change this to possible a timer
  </div>
</header>