title: YouTube autoplay not working in Chrome
body: <p>For a while now I have been using this script, where the video is automatically playing full-screen. For now suddenly the video doesn't play automatically in Chrome. But in Firefox and Edge it still works.</p>
  
  <p>So maybe Google changed settings? Does anyone know how to fix this, please?
  You see the live example here: <a href="http://www.brunomazereel.com/" rel="noreferrer">www.brunomazereel.com</a></p>
  
  <pre><code>&lt;script src="http://www.youtube.com/player_api"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
  var player;
  function onYouTubePlayerAPIReady() {
      player = new YT.Player('player', {
      playerVars: {
          'autoplay': 1,
          'controls': 0,
          'autohide': 1,
          'wmode': 'opaque',
          'showinfo': 0,
          'loop': 1,
          'rel': 0,
          'playlist': 'rh5QiehIlVA,Bl63bdR-Ko0,'
          },
      videoId: 'u-cjliof1xk',
      events: {
          'onReady': onPlayerReady
      }
  });
  }
  function onPlayerReady(event) {
  event.target();
  $('#text').fadeIn(400);
  }
  $(window).scroll(function() {
  var hT = $('.m-video').height(),
     wS = $(this).scrollTop();
  if (wS &gt; hT) {
    player.pauseVideo();
  }
  else {
    player.playVideo();
  }
  });
  &lt;/script&gt;
  </code></pre>