0

Is there a way to use a YouTube video link in the <video> 's source tag so that I do not have to download the video file and upload it to my server?

I wan to play a YouTube video as a background on my site so I do not want to use iframe embeds because this technique would require some quirky hacks to hide the video player controls and prevent users interacting with the video (pausing, starting, etc.).

Having the video embedded in the <video> tag would be the best approach.

luqo33
  • 8,001
  • 16
  • 54
  • 107

1 Answers1

0

You can use this awesome Plyr package and install it via

NPM, bower, Ember or use a CDN

  • It's semantic ( tag )
  • Responsive
  • For Youtube and Vimeo
  • Written in "vanilla" JavaScript ( No libraries dependencies )

and the total weight is less than 60 Kb totally acceptable.

Héctor León
  • 2,210
  • 2
  • 23
  • 36