mkz4816
mkz4816

Reputation: 41

Remove Play/Pause on embedded youtube video

I have embedded a youtube video on my site, and want to remove all play/pause functionality form it. I have already made it so that the controls are not visible; however, the video still pauses when the user clicks on the video.

I'm using a youtube "player" and div to embed it:

<div id="player" style="position: absolute; width:100%; height: 100%;" frameborder="0">   </div>

<script>
var player;
  function onYouTubeIframeAPIReady() {
    player = new YT.Player('player', {
      height: '100%',
      width: '100%',
      videoId: 'Ir8-0xOptFA',
      playerVars: { 'autoplay': 1, 'controls': 0, 'showinfo' : 0, 'wmode' : 'transparent', 'modestbranding': 1},
      events: {
        'onReady': onPlayerReady,
      },
      version: 3
    });
  }
 </script>

The idea is that this video will serve as the 'background' for the main page of the site. Any insights would be much appreciated!

Upvotes: 2

Views: 4544

Answers (2)

Chrisji
Chrisji

Reputation: 311

Have you thought about overlaying a transparent DIV?

Your question may have already been answered here?

Upvotes: 1

LOTUSMS
LOTUSMS

Reputation: 10240

Look into THIS link

And THIS link.

You may have to load the preview image in place of the button. Not sure if that will help

Upvotes: -1

Related Questions