angular-video-bg
angular-video-bg copied to clipboard
Ratio < 1
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.