JavascriptSubtitlesOctopus
JavascriptSubtitlesOctopus copied to clipboard
feat: Add optional skipAspectRatioCheck
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:
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:
I understand that my case is non-standard, so I allowed to hide standard behavior by optional prop