Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
is it possible to have a video as a background for the site or for a container? |
||||
|
Yes, that's possible. Create a HTML Video element anywhere on the website and select your video into it. Then: - Check 'Play' for the video - Uncheck 'Controller' - Right-Click the video and select "HTML Code" - in Additional Attributes, enter "loop muted" - In Additional CSS styles enter:
Then you have a fullscreen background video playing. |
||||
|
Just a caution note on this: A full screen background video does not take into account the video's original aspect ratio, i.e. the video's aspect ratio will inevitably be distorted, depending on the viewer's viewport aspect ratio. |
||||
|
No, that shouldn't be distorted, that's why I added object-fit: cover |
||||
|
I have just tried it. You're right: the video does not get distorted but it gets cropped. If I press F11 for full screen browser view my viewport height increases while viewport width remains unchanged, and as a result the video gets cropped a bit on the left and on the right. If I decrease my browser width, the video gets cropped as well. So after all, using a video for background makes sense only if cropping doesn't matter, i.e. if the video's content ist just abstract color or graphic pattern, or maybe a landscape view. |
||||
|
Yes, either you get distortion or cropping, whatever you prefer :) |
|