psvideo: allow rotation 270 (fix #394)

Signed-off-by: Varun Patil <radialapps@gmail.com>
pull/653/head
Varun Patil 2023-05-06 14:29:30 -07:00
parent d0335adcb5
commit 118f709154
1 changed files with 9 additions and 4 deletions

View File

@ -459,11 +459,16 @@ class VideoContentSetup {
const hasRotation = rotation === 90 || rotation === 270;
if (hasRotation) {
content.videoElement.style.width = content.element!.style.height;
content.videoElement.style.height = content.element!.style.width;
const vw = (content.videoElement.style.width = content.element!.style.height);
const vh = (content.videoElement.style.height = content.element!.style.width);
transform = `translateY(-${content.element!.style.width}) ${transform}`;
content.videoElement.style.transformOrigin = 'bottom left';
if (rotation === 90) {
transform = `translateY(-${vh}) ${transform}`;
content.videoElement.style.transformOrigin = 'bottom left';
} else if (rotation === 270) {
transform = `translateX(-${vw}) ${transform}`;
content.videoElement.style.transformOrigin = 'top right';
}
}
content.videoElement.style.transform = transform;