Skip to content

Commit

Permalink
fix: crash due to remeasured bitrate in ios fixed #63
Browse files Browse the repository at this point in the history
  • Loading branch information
numandev1 committed Dec 21, 2021
1 parent 92ef770 commit 5c6e4f2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion example/src/Screens/Video/index.tsx
Expand Up @@ -114,7 +114,6 @@ export default function App() {
{
compressionMethod: 'auto',
minimumFileSizeForCompress: 5,
maxSize: 1000,
},
(progress) => {
if (backgroundMode) {
Expand Down
2 changes: 1 addition & 1 deletion ios/Video/VideoCompressor.swift
Expand Up @@ -247,7 +247,7 @@ func makeValidUri(filePath: String) -> String {
let maxBitrate:Int = 1669000
let minValue:Float=min(Float(originalHeight)/Float(height),Float(originalWidth)/Float(width))
var remeasuredBitrate:Int = Int(Float(originalBitrate) / minValue)
remeasuredBitrate = remeasuredBitrate*Int(compressFactor)
remeasuredBitrate = Int(Float(remeasuredBitrate)*compressFactor)
let minBitrate:Int = self.getVideoBitrateWithFactor(f: minCompressFactor) / (1280 * 720 / (width * height))
if (originalBitrate < minBitrate) {
return remeasuredBitrate;
Expand Down

0 comments on commit 5c6e4f2

Please sign in to comment.