Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scale video by height not by width #54

Open
GoogleCodeExporter opened this issue Mar 15, 2016 · 1 comment
Open

Scale video by height not by width #54

GoogleCodeExporter opened this issue Mar 15, 2016 · 1 comment

Comments

@GoogleCodeExporter
Copy link

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 [email protected] on 3 Apr 2014 at 8:17

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 23 Jul 2015 at 1:39

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant