angular-video-bg icon indicating copy to clipboard operation
angular-video-bg copied to clipboard

Ratio < 1

Open 360disrupt opened this issue 8 years ago • 0 comments

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.

360disrupt avatar Apr 06 '16 12:04 360disrupt