1

I am using React Native to develop an app. I get an error when trying to upload a video more than 20 sec. The code works fine for small videos.

const response = await fetch(videoPicker)
    const blob = await response.blob()
    const path = `video/${moment().format('YYYYMMDD')}/${uuidv4()}.mp4`
    Storage.put(path, blob, {
      progressCallback(progress) {
        setProgress((progress.loaded / progress.total * 100).toFixed(0))
        console.log(`Uploaded: ${progress.loaded}/${progress.total}`);
      }
    })

I tried android:hardwareAccelerated="false" and android:largeHeap="true". I think it helped. But not much.

Here is a screenshot for more illustration.enter image description here

Shareef Dweikat
  • 361
  • 2
  • 13

0 Answers0