Skip to content
New issue

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

Cannot compress videos, only on real Android devices. #315

Open
DIGITALSQUAD opened this issue Nov 7, 2024 · 1 comment
Open

Cannot compress videos, only on real Android devices. #315

DIGITALSQUAD opened this issue Nov 7, 2024 · 1 comment

Comments

@DIGITALSQUAD
Copy link

The following code works fine on Android simulators but does not work only on real Android devices.
On emulators, it starts compressing and show the Compression Progress and successfully compress videos.
However, it finishes immediately on real Android devices and the result file is only 28 bytes.

The variables filePath is like file:///data/user/0/com.myapp.app/cache/rn_image_picker_lib_temp_e6b2c4f4.mp4 and result is like file:///data/user/0/com.myapp.app/cache/bad8a788-36e0-41fc-983b-a6fc340e29ff.mp4 both on emulators and real devices.

Does anyone have any ideas on fixing this issue?

async compressVideo(filePath) {
  const result = await Video.compress(
    filePath,
    { compressionMethod: "auto" },
    (progress) => {
      console.log('Compression Progress: ', progress);
    }
  )

  return RNFetchBlob.fs.readFile(result, 'base64').then(data => new Buffer(data, 'base64'))
}
Copy link

github-actions bot commented Nov 7, 2024

👋 @DIGITALSQUAD
Thanks for opening your issue here! If you find this package useful hit the star🌟!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant