Skip to content

Conversation

Ruslan-Zakharov
Copy link

@Ruslan-Zakharov Ruslan-Zakharov commented Oct 3, 2023

In my project, I need to make a manual crop for video.
For example - I make a horizontal crop(16/9) for a video with a vertical aspect ratio(9/16) with scaling it.

Actual result:
image
This happens because the subtitles octopus checks the original video aspect ratio and gets the width according to this value.
self.getVideoPosition = function () { var videoRatio = self.video.videoWidth / self.video.videoHeight; var width = self.video.offsetWidth, height = self.video.offsetHeight; var elementRatio = width / height; var realWidth = width, realHeight = height; if (elementRatio > videoRatio) realWidth = Math.floor(height * videoRatio); else realHeight = Math.floor(width / videoRatio); .... }

Expected result:
image

I understand that my case is non-standard, so I allowed to hide standard behavior by optional prop

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

Successfully merging this pull request may close these issues.

1 participant