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

upchunk for ReactNative #33

Closed
hossein-zare opened this issue Sep 3, 2020 · 11 comments
Closed

upchunk for ReactNative #33

hossein-zare opened this issue Sep 3, 2020 · 11 comments

Comments

@hossein-zare
Copy link

Hello,

Does this package support ReactNative?

@dylanjha
Copy link
Contributor

dylanjha commented Sep 4, 2020

Hi @hossein-zare thanks for the question.

No, it does not. Last I checked React Native didn't have some of the top level constructors that this package uses:

  • Blob
  • File
  • FileReader

I can't remember if it was some or all of those that were not supported in RN. If you're using this with Mux, you can send a PUT request to the upload URL with the file content in the request body. In a similar vein, I have also heard of some folks using Expo's uploadAsync functionality with success, RN itself may have something similar that you can leverage.

@adrienfloor
Copy link

Hey @dylanjha
I apologise for re-opening this but I've been working a lot on uploading large video files from a react native app to Mux.
So far nothing conclusive. I'm not using expo btw, and I need the upload to keep going even if the app goes in background mode (since it can be quite long). I know all about the mux documentation and I'm doing everything right, it's just the upload process itself that has been an unbelievable pain.
I've been working on it and trying things for weeks so kinda desperate 😅 could you help me on what to do from here please ?
Thank you so much 🙌🏼

@dylanjha
Copy link
Contributor

Hi @adrienfloor

Have you tried this library: https://github.com/Vydia/react-native-background-upload

It looks like with method: 'PUT' and type: 'raw' that could work.

@adrienfloor
Copy link

Yes I did. It's alright for relatively small video files of a few minutes, but for larger it does always fail.
The solution would be to compress the file before uploading it but I can't figure out something that compresses efficiently without losing too much quality, I've tried many things, and compressing on the client doesn't seems like a clever choice since MUX is already doing it while processing the file it receives.

@hossein-zare
Copy link
Author

hossein-zare commented Sep 11, 2021

Hello again, @adrienfloor
You can try https://github.com/hossein-zare/react-native-chunk-upload

Not sure about...

I need the upload to keep going even if the app goes in background mode (since it can be quite long)

@adrienfloor
Copy link

I'm working on it right now @hossein-zare, thank you 👍

@adrienfloor
Copy link

adrienfloor commented Sep 11, 2021

Hey again @dylanjha
We've been trying to use this package with MUX : https://github.com/hossein-zare/react-native-chunk-upload and had some troubles along the way.
If you had 5 minute to check this out and give some feedback we would really appreciate it : hossein-zare/react-native-chunk-upload#7
Thanks again 🙌🏼

@nikitph
Copy link

nikitph commented Mar 14, 2023

Hello. great job on the library! Has anything changed wrt RN support here?

@lucasasalmins
Copy link

also would love some react native support!

@Osmanity
Copy link

Osmanity commented Oct 2, 2023

This mux service is to good for it not being supported in react native🙏

@dylanjha
Copy link
Contributor

dylanjha commented Oct 3, 2023

@nikitph @lucasasalmins @Osmanity thanks for your feedback here

A couple things:

First off, we have a slightly better story now for RN. Not a fully baked RN SDK, but we do have Upload SDKs for both iOS and Android now

We have at least 1 customer who has integrating these upload SDKs into their React Native app. I know it's not as nice as you would like. There's a number of resources around bridging native SDKs into RN apps. That might be worth looking into.

We would ❤️ to build a fully RN SDK, or as an intermediate step create some resources to help folks bridge our native uploader SDKs into RN but it's not on the immediate roadmap. Having native SDKs for us is the first step so that when we have the bandwidth we can create a RN SDK that interfaces with these native SDKs that now support.

Secondly, and this might be more helpful for the immediate term is that Mux Direct Upload URLs are Google Cloud Storage URLs. There's nothing special or Mux specific about it. Any RN library that supports uploading to GCS should work just fine with Mux Direct Upload URLs.

Hope that's helpful. Please comment here with your experience to help others who run into the same issue.

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

6 participants