SDK 30: Cannot build or publish bundled video assets larger than 50MB

#1

Im trying to bundle a number of video files (100 MBs each) to my app so that the user can play them offline without having to download them from internet (client requirement). Im on expo SDK 30 and tried the offline method suggested by documentation (assetBundlePatterns).

Problem is it looks like expo uploads the video files to server first then decides if it should bundle it with app binary or not. Because it works fine if my video file size less that 50MB but when I go higher it throws me the Exceeding maximum js bandwidth error. Which means expo actually tries to upload the file whereas I specified not to .

So what is the solution ? How Can I include files larger than 50MB ?
My app is not detached/ejected (I have also tried detaching but same thing)

Environment

Expo / iOS && Android / SDK 30

Steps to reproduce

  • Add a video larger than 50MB to your assets/video folder
  • have this in your code
 <Video
                            source={require("../../../assets/videos/sample_edit_new.mp4")}
                            rate={1.0}
                            volume={1.0}
                            isMuted={false}
                            resizeMode="cover"
                            shouldPlay = {false}
                            isLooping = {false}
                            style={{ width: 500, height: 300 }}
                            useNativeControls
                        />
  • Specify that path in assetBundlePatterns
"assetBundlePatterns": [
  "assets/videos/*"
],
  • run expo publish or expo build:ios in terminal

Observed Behaviour

  • When trying expo publish I get
[16:02:35] Finished building JavaScript bundle in 15924ms.
[16:02:35] Uploading assets
[16:02:48] Uploading /assets/videos/roleplay.mp4
[16:02:48] 'Request body larger than maxBodyLength limit'
  • When trying expo build:ios I get
[15:27:46] Publishing to channel 'default'...
[15:27:48] Building iOS bundle
[15:27:53]' Error: socket hang up'
#2

We have some limit set to avoid the need to store such big assets.

We’re discussing this issue in Expo team - we’ll come back if we’ll figure something out for you.

What you probably can do is host these files somewhere (ex. S3), download them (during the first run of the app for example) in code and store using FileSystem library.

#3

Thanks, I ended up compressing each file down to 10mb. But then I noticed another barrier, so it works if I have a set of 9 files each 10mb . It tries to upload them and then decides to bypass them. But if I try to bundle 10 files (each 10) then the whole operation is aborted like before. So there’s another check for the sum of assets I uploaded every time I want to build/publish.

I still cannot understand why the system tries to store/upload the assets first and then check whether to bypass that path/directoy or not. Is there a way to completely store the files offline without requiring the internet access to download and cache them afterwards?

closed #4

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.