I've used jQuery.YoutubeBackground for my background video on my website (apexonlineracing.com/home)
However, if you adjust the browser all responsive code is dropped and the video becomes massive. I've tried setting "overflow:hidden;" to hide the original overflow. I've also tried dropped "max-width:100%;" which again does nothing.
HTML:
<div id="video"></div>
jQuery:
<script>
jQuery(function($) {
$('#video').YTPlayer({
fitToBackground: true,
playerVars: {rel: 0},
videoId: '2kZ7BsU2y7U',
pauseOnScroll: false,
playerVars: {
modestbranding: 1,
autoplay: 1,
loop: 1,
controls: 1,
rel: 0,
autohide: 0
}
});
});
CSS:
<style>
#video{
position: relative;
background: transparent;
overflow:hidden;
}
.ytplayer{
position: absolute;
top: 0;
z-index: 0;
}
</style>
Can anyone shed any light exactly what is causing this and how I can prevent it (i'd also like to drop overflow:hidden; but this causes the browser to scroll left, which I don't want.)