pupunzi / jquery.mb.YTPlayer

use a custom yutube player for a video as background on jQuery framework
https://pupunzi.com/mb.components/mb.YTPlayer/demo/demo.html
1.3k stars 431 forks source link

Image after video is done playing #354

Closed mfahem closed 6 years ago

mfahem commented 6 years ago

Hello,

I am playing the video once (by setting loop to false) but I would like to have a background image at the end of the video. How can I achieve that please ?

Thanks :)

pupunzi commented 6 years ago

Hi, you can just add a background image via CSS to the element you are instancing the background video.

If the YTPlayer is instanced for the body you can add a background as follow in your css:

body {
      background-image: url("[path to the background inage]");
      background-position: center center;
      background-repeat: no-repeat;
      background-size: cover;
}

This way when the video end the background image will be visible.

mfahem commented 6 years ago

Thank you it worked ! :)