mike2355 / jquery-tubular

Automatically exported from code.google.com/p/jquery-tubular
MIT License
0 stars 0 forks source link

Scale video by height not by width #54

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hello there, really loving this plugin so first of all thanks for all the hard 
work Sean. I am using this on a clients website and it works fine however the 
video goes to 100% width so I end up with letterboxing on the top and bottom I 
was wondering if there is a way I can scale the video to 100% height so it 
exceeds the width and in return fills the whole screen?

Thanks again

Original issue reported on code.google.com by samjayhe...@gmail.com on 3 Apr 2014 at 8:17

GoogleCodeExporter commented 8 years ago
Just comment out all of this if statement on line 92:

if (width / options.ratio < height) { // if new video height < window height 
(gap underneath)
                pWidth = Math.ceil(height * options.ratio); // get new player width
                $tubularPlayer.width(pWidth).height(height).css({left: (width - pWidth) / 2, top: 0}); // player width is greater, offset left; reset top
            } else { // new video width < window width (gap to right)
                pHeight = Math.ceil(width / options.ratio); // get new player height
                $tubularPlayer.width(width).height(pHeight).css({left: 0, top: (height - pHeight) / 2}); // player height is greater, offset top; reset left
            }

Original comment by DCMFra...@gmail.com on 23 Jul 2015 at 1:39