Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: Add optional skipAspectRatioCheck #161

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant