itinance / react-native-fs

Native filesystem access for react-native
MIT License
4.89k stars 954 forks source link

i want compress video, but the return progress is not working !!! #1191

Open fitri612 opened 10 months ago

fitri612 commented 10 months ago

const onVideoRecordingFinished = async videoPath => { setIsVideoRecording(false); const path = 'file://' + videoPath; const metaData = await getVideoMetaData(path); console.log('Video Meta Data: ', metaData); const result = await Video.compress( path, { compressionMethod: 'auto', }, progress => { if (backgroundMode) { console.log('Compression Progress: ', progress); } else { console.log('Compression Progress: ', progress); } }, ); const metaDataCompressed = await getVideoMetaData(result); console.log('Video Meta Data: 2 ', metaDataCompressed); navigation.navigate('ReelsPostScreen', { uri: result, type: 'video/mp4', name: ${videoPath.slice(videoPath.length - 29)}, }); }

// information log path is : file:///storage/emulated/0/Android/data/com.newfemmewanitaindonesia.newfemme/files/Movies/video_2023_06_29_10_25_39.mp4

can you solve this problem ?