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

Introduce a maxAspectRatio option to limit the height of the embedded video. #104

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

thruflo
Copy link

@thruflo thruflo commented Mar 24, 2013

Allows the aspect ratio of the embedded video to be limited. For example,
if using:

$('.selector').fitVids({'maxAspectRatio': 0.5625});

Embedded videos encoded at aspect ratios "squarer" than 16x9 will be vertically
letterboxed, i.e.: displayed centred in the .fluid-width-video-wrapper with
black edges down the side.

My use case for this is a responsive gallery unit where I want images and videos to display at the same size (without having control of the videos that are displayed in it). Without this option, fitvids embeds the videos at the width of the container x the native aspect ratio of the video. So 4x3 videos are much deeper than 16x9 videos. With this option, I can constrain the 4x3 videos to display (centred, vertically letterboxed) within a 16x9 container.

Allows the aspect ratio of the embedded video to be limited. For example,
if using:

    $('.selector').fitVids({'maxAspectRatio': 0.5625});

Embedded videos encoded at aspect ratios "squarer" than 16x9 will be vertically
letterboxed, i.e.: displayed centred in the `.fluid-width-video-wrapper` with
black edges down the side.
@davatron5000
Copy link
Owner

The default maxAspectRatio wouldn't work here because some videos (iPhone uploaded to Flickr) are in portrait.

@spanishgringo
Copy link

True, but you can leave the default as none and still let users asign a maxAspectRatio if needed.

@codekipple
Copy link

Thanks, this setting was what i was looking for, i too needed a way to restrict the videos aspect ratio.

@davatron5000
Copy link
Owner

I'm down to add this into (the mythical) FitVids 2.0, but is everyone on board for setting the default to false and then doing a check for its "truthiness" inside the if statement?

@leoj3n
Copy link

leoj3n commented Dec 28, 2013

@davatron5000 🚢

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

Successfully merging this pull request may close these issues.

6 participants