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

Ratio < 1 #20

Open
360disrupt opened this issue Apr 6, 2016 · 0 comments
Open

Ratio < 1 #20

360disrupt opened this issue Apr 6, 2016 · 0 comments

Comments

@360disrupt
Copy link

Ratios <1 are not supported. It should stretch the video to vertical instead of horizontal.

I tried to adjust this function:
getPlayerDimensions but I don't quite understand what it is doing. My approach would be something similar to this:

                function getPlayerDimensions() {
                    var aspectHeight = 0, aspectWidth = 0;
                    if(parseInt(scope.ratio) >=1) {
                        aspectWidth = parentDimensions.width;
                        aspectHeight = parseInt(aspectWidth / scope.ratio, 10);
                    }
                    else {
                        aspectHeight = parentDimensions.height;
                        aspectWidth = parseInt(aspectHeight * scope.ratio, 10);
                    }
                    console.log(aspectWidth, aspectHeight);
                    return {
                        width: aspectWidth,
                        height: aspectHeight
                    };

                }

It is way to small and the backround image is added to the sides instead of stretching the iframe correctly.

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

No branches or pull requests

1 participant