Put Youtube video as website background

Asked

Viewed 943 times

0

I want to put a background video on a wait screen. Can you do this by pulling a video from youtube without showing the default buttons and have it start automatically? The Jquery I have to put the video that is on my host.

$('body').bg({
position:"fixed",
zIndex:-1,
mp4:'meuvideo.mp4',
ogv:'meuvideo.ogv',
webm:'meuvideo.webm',
poster:'meuvideo.jpg',
opacity:0.5
});

Here I pull the video straight from my server, and youtube?

  • Even with background, I don’t know if it does, but if it makes no difference, try as follows: https://jsfiddle.net/ks8hu650/12/

1 answer

1


Felipe, good afternoon.

You can place a youtube video as background using a modified youtube link itself. This link contains additional information both on pathInfo how much in parameters

Using an iframe, as the @Miguel user commented, you can leave the video as a background:

<iframe frameborder="0" height="100%" width="100%" src="https://youtube.com/embed/ID?autoplay=1&controls=0&showinfo=0&autohide=1">
</iframe>

Note that you need to change the IDfrom the link posted above with the corresponding video ID. Whereas:

  • the parameter autoplay=1 means the video will start automatically.
  • the parameter controls=0 means there will be no control options such as play, volume, config, full screen, subtitles etc.
  • the parameter showinfo=0 means the player will not show the name of the video
  • the parameter autohide=1 means the video progress bar will be invisible.

You can read information here

Browser other questions tagged

You are not signed in. Login or sign up in order to post.