htmlcssmobileyoutubeadaptive-design

Background video from Youtube doesn't start while in mobile resolution


I used CSS and Youtube IFrame to make a background-video, but it doesn't start after I switch to mobile resolution (using F12 etc.).

Screenshot from Chrome, it is the same on mobile.

GitHub repo with my code.

<div class="video-background">
  <div class="video-foreground">
    <iframe src="https://www.youtube.com/embed/W0LHTWG-UmQ?controls=0&showinfo=0&rel=0&autoplay=1&loop=1&playlist=W0LHTWG-UmQ" frameborder="0" allowfullscreen></iframe>
  </div>
</div>

Solution

  • Mobile phones don't support autoplay bg-video. So i used to set an img while on mobile version.