This time I will share jQuery Plugin and tutorial about Customizable Video Background Plugin – jQuery backgroundVideo, hope it will help you in programming stack.
Yet another jQuery video background plugin to make your webpage more gorgeous and attractive.
The jQuery backgroundVideo plugin enables you to embed an HTML5 video into the page and make it as the background for the whole webpage or a specific container element.
Features autoplay, poster, controls, infinite loop, video preload, web video text tracks and much more.
Fore Chrome users, read this article: Autoplay Policy Changes
How to use it:
1. Download and load the backgroundVideo.js script after you’ve loaded jQuery library (slim build).
2 |
integrity = "sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" |
3 |
crossorigin = "anonymous" > |
5 |
< script src = "src/backgroundVideo.js" ></ script > |
2. Call the function on the target container and specify the path your video file.
1 |
$( ".wrapper" ).backgroundVideo({ |
3. Not only mp4, the plugin supports any type of video: ogg, webm, mpeg, m4v, etc.
01 |
$( ".wrapper" ).backgroundVideo({ |
02 |
mpeg: "path/to/mpeg-file" , |
03 |
mp4: "path/to/mp4-file" , |
04 |
webm: "path/to/webm-file" , |
05 |
ogg: "path/to/ogg-file" , |
06 |
quicktime: "path/to/quicktime-file" , |
07 |
x_msvideo: "path/to/x-msvideo-file" , |
08 |
m4v: "path/to/m4v-file" , |
09 |
rtf: "path/to/rtf-file" , |
4. Customize the video background with the following options.
01 |
$( ".wrapper" ).backgroundVideo({ |
25 |
poster: "path/to/image-file" , |
28 |
notSupportedText: "Your browser does not support HTML5 video." , |
35 |
track_src: "path/to/vvt-file" , |
36 |
track_kind: "subtitle" , |
This awesome jQuery plugin is developed by mikeludemann. For more Advanced Usages, please check the demo page or visit the official website.