jQuery.VideoBG – HTML5 Video Background jQuery Plugin

jQuery.VideoBG plugin provide the functionality to add HTML5 video as a background in website or any div where you want display videos. Main benefit of this plugin is ,browser which is not support HTML5 also can use it. its using image instead of video.

Note: You don’t use many videos in your website or in a single page because it is using both bandwidth you as well as your visitors.

You can also check other recommended jQuery tutorials,

jQuery.VideoBG

VideoImage
Firefox 4 (the best experience)Yes (webm)Yes
Internet Explorer 9Yes (mp4)Yes
Firefox 3.5Yes (ogv)Yes
ChromeYes (webm/mp4)Yes
SafariYes (mp4)Yes
Opera 10.5+Yes (ogv)Yes
Internet Explorer 8NoYes
Internet Explorer 7NoYes
Android BrowserNoYes
Mobile SafariDoes not modify default behaviour
Older Browsers that support position:fixedNoYes
Archaic browsersDoes not modify default behaviour

If the containing element’s width and height does not match the aspect ration of the video, the video will not stretch to fill the container but will render based on the largest dimension.
Public methods:
Play: Trigger a play/pause event on the chosen video background. Will play if the video is already paused. Will pause if the video is already playing.
Mute: Trigger a mute/unmute event on the chosen video background. Will unmute if the video is already muted. Will mute if the video is unmuted.
Destroy: Will destroy the chosen video background. Will unbind events bound when the video background is initialised. Will remove HTML attached to the DOM by the plugin. If a controlPosition parameter is set this will also have to be set to safely remove all HTML elements from the DOM.
Resize: When invoked this will resize the video background to the height of the document or window. The video background height affects the height of the document which affects the video background’s ability to negatively resize.
Plugin parameters:
VideoSource: Either an array of strings of video URL’s or a two-dimensional array containing video URL’s and type. No default.
Poster: The URL string of the image used for the video poster attribute. No default.
Autoplay: Video autoplay attribute boolean. Default is true.
Preload: Video prelod attribute string. Default is none.
Loop: Video loop attribute boolean. Default is false.
ControlPosition: Position of the video controls, will append the controls to choose DOM element. Default is null. If null will append controls to the element the video background has been applied to.
ControlText: An array of text options for the video control elements.
Resize: Boolean which will trigger the video background to resize to match the browser height. Set to false is video background is used on another element. Default is true.
PreloadHtml: If required, a user controlled HTML string can be injected in to the control area of the page while the video is preloading. It will be over written by the video controls when the video is ready to play.
PreloadCallback: Allows a function to be triggered when the video preload is initiated.
LoadedCallback: Allows a function to be triggered when the video is loaded.
ResizeTo: Allows the video background to resize to either the document or the window. Default is document.