johnsamir
Advanced OT User
The problem is that if i use incognito browser eveyrthing seems ok the video size cover all the website, it owrks as a background.
but if i don't use the browser like that the video appears very small
have added this into header.php
because the code did not worked nor index.php, index.html
this is my style.css
would like it to work as a background image.. but in thsi case a video
but if i don't use the browser like that the video appears very small
have added this into header.php
PHP:
<div class="video-background">
<iframe id="bgvid" width="100%" height="100%" src="https://www.youtube.com/embed/-jK5CSXETb8?autoplay=1&mute=1&loop=1&playlist=-jK5CSXETb8&enablejsapi=1" frameborder="0" allowfullscreen></iframe>
</div>
<script src="https://www.youtube.com/iframe_api"></script>
<script>
var player;
function onYouTubeIframeAPIReady() {
player = new YT.Player('bgvid', {
events: {
'onReady': onPlayerReady
}
});
}
function onPlayerReady(event) {
event.target.playVideo();
var playerElement = document.getElementById('bgvid');
playerElement.style.pointerEvents = 'none';
playerElement.style.display = 'block';
}
</script>
because the code did not worked nor index.php, index.html
this is my style.css
Code:
@import url('https://fonts.googleapis.com/css?family=Patua+One');
body
{
/*background: url(img/bg.png) no-repeat center top #0d0f12;*/
margin: 0;
padding: 0;
font-size: 13px;
font-family: 'Open Sans', sans-serif;
background: #0d0f12; /* Fallback background color */
}
.video-background {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: -100;
overflow: hidden;
}
.video-background {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1; /* Ensure the video is behind other content */
overflow: hidden;
}
#bgvid {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none; /* Disable interaction with the video */
}