We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ios crash on compress video
not crash
0.72.4
1.8.24
/** * https://github.com/numandev1/react-native-compressor/issues/217#issuecomment-1807184218 * @param fileUrl * @param compressVideoQuality */ const compressVideo = async (fileUrl: string, compressVideoQuality = 0.85): Promise<string> => { const originalVideoMetada = (await getVideoMetaData(fileUrl)) as any; const originalBitrate: number = originalVideoMetada.size / ((originalVideoMetada.duration / 60) * 0.0075); // sizeInKb / (minutes * 0.0075) const targetBitrate: number = Math.round(originalBitrate * compressVideoQuality); return await Video.compress( fileUrl, { progressDivider: 20, maxSize: 720, bitrate: targetBitrate, compressionMethod: 'manual', downloadProgress: progress => { console.log('> compressVideo download progress: ', progress); }, }, progress => { console.log('> compressVideo compress progress: ', progress); }, ); };
change
var bitRate=options["bitrate"] as! Float?;
to
var bitRate = (options["bitrate"] as? NSNumber)?.floatValue;
The text was updated successfully, but these errors were encountered:
👋 @krmao Thanks for opening your issue here! If you find this package useful hit the star🌟!
Sorry, something went wrong.
No branches or pull requests
Current behavior
ios crash on compress video
Expected behavior
not crash
Platform
React Native Version
0.72.4
React Native Compressor Version
1.8.24
Reproducible Steps And Demo
Quick fix
change
to
The text was updated successfully, but these errors were encountered: