JavascriptSubtitlesOctopus icon indicating copy to clipboard operation
JavascriptSubtitlesOctopus copied to clipboard

feat: Add optional skipAspectRatioCheck

Open Ruslan-Zakharov opened this issue 2 years ago • 0 comments

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

Ruslan-Zakharov avatar Oct 03 '23 08:10 Ruslan-Zakharov