Support » Plugin: mb.YTPlayer for background videos » [Plugin: mb.YTPlayer for background videos] Horizontal fitting

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author pupunzi



    You should edit the jquery.mb.YTPlayer.js and replace the jQuery.fn.optimizeDisplay with:

    	var player=this.get(0);
    	var data = jQuery("#""_data").data();
    	var wrapper = jQuery("#wrapper_";
    	var lightCrop = true; //data.lightCrop;
    	var win={};
    	var el= data.ID?jQuery("#"+data.ID):jQuery(window);
    	win.width= el.width();
    	win.height= el.height();
    	var vid={};
    	vid.width = win.width + ( lightCrop ? (win.width*20/100): 0 );
    	vid.height = data.ratio == "16/9" ? Math.ceil((9*win.width)/16): Math.ceil((3*win.width)/4);
    	var marginTop= -((vid.height-win.height)/2);
    	var marginLeft= -( lightCrop ? (win.width*10/100): 0 );
    	wrapper.css({width:vid.width, height:vid.height, marginTop:marginTop, marginLeft:marginLeft});

    This will remove the optimization for the screen size.


    how to make a background to all window, on my site background video have some spaces and in my plugin setting page is not Section “home video ratio”.

    Plugin Author pupunzi


    In the latest 1.0 version the aspect ratio option has been removed as the component retrieve the ratio from a direct call to the YT FEED API. In the response of that call there’s a parameter that specify if the video is widescreen or not and the component use this to set either the 16/9 or the 4/3 aspect ratio.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: mb.YTPlayer for background videos] Horizontal fitting’ is closed to new replies.