new BackgroundVideo({ /* * container [optional]: id of the element, where to add video background. * If ommited video background is added to the BODY element. * Example: * container: "myId", */ /* * video: list of video files * * Note: If you have one video in different formats (mp4, webm, ogv, etc) * you can add them all to ensure browser compatibility. * Use 'formats' option to list all additional formats. */ video: [ { file: "1.mp4" }, { file: "v2.ogv", formats: [ "mp4", "webm" ] }, { file: "3.mp4" } ], /* * To save traffic mobile users see a still image instead of video. */ mobileImg: "poster.jpg" }); .flexible { position:absolute; object-fit: cover; width: 100%; height: 100%; z-index: -999; top: 0; left: 0; }