Closed CyberiaResurrection closed 5 years ago
Hi, How are you initializing the YTPlayer to run inside the DIV? The right way that will not distort the original containment div is:
<!-- The div where the video will play as background -->
<div id="myVideoBanner" class="myVideoBanner"></div>
<!-- The div to declare the player -->
<div id="P1" class="player"
data-property="{ videoURL:'http://youtu.be/xxxxxx', containment:'#myVideoBanner', startAt:0, mute:false, autoPlay:true, loop:true,opacity:1}">
</div>
And then via javascript:
jQuery(function(){
jQuery("#P1").YTPlayer();
});
This will not modify the DIV.
While if you use "self" as containment declaring the background video on the same DIV the player will be managed not as background but as a chromeless player forcing the aspect ratio of the container to fit the video size.
Thanks - that worked.
I'm using version 3.2.9 to try to embed a youtube video as a background for a specific div on the page. That's working, but distorts the size of the containing div - how can I pass a specific size (whether in pixels, %, vh/vw, etc) into the dataProperty to avoid that distortion?