Skip to content

Ratio < 1 #20

@360disrupt

Description

@360disrupt

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions