itinance / itinance/react-native-fs

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

Open
#1,191 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
5k
Forks
1k
PR merge metrics
No merged PRs in 30d

Description

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 ?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.