-
-
Notifications
You must be signed in to change notification settings - Fork 668
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
Can't upload video from camera roll #3624
Comments
I cant either do that from android |
Hi! Thanks for the reports. I just tested, and this works for me. (On Android 10 with v26.20.143, the latest.) @maltokyo @astyltsvig can you say in more detail what steps you try, and what result you see? One thing that may confound this is #2684. Videos tend to be much bigger than photos, so they can naturally take some time to upload (often like 10 seconds, potentially much longer), depending on the speed of your connection to the Internet and to your Zulip server. We ought to show something like a progress bar while that's happening, but we currently don't and instead it looks like nothing happened at all, until the whole file finishes uploading; that's #2684. |
This may depend on work in #2887, which has become stale. If the way is clear, I can work on adding video support, as I'm familiar with both react-native-image-picker and react-native-image-crop-picker (which #2887 proposes to introduce). I know it's possible to get video from the media library and directly from the camera with some combination of these libraries — on iOS — with React Native (with a few hiccups like ivpusic/react-native-image-crop-picker#818); the details will come back to me if I start working on this, and I can see how it goes with Android. |
I just reproduced this on iOS -- specifically on an iPhone XR running iOS 13.3 and Zulip 26.27.150.
This looks like we're just not using the right API on iOS to say "please let the user select a photo or video from the camera roll" -- we're probably instead invoking the API in a way that says "please let the user select specifically a photo from the camera roll". The relevant code in our app is in import * as ImagePicker from 'react-native-image-picker';
// ...
handleImagePicker = () => {
ImagePicker.launchImageLibrary(
{
quality: 1.0,
noData: true,
storageOptions: {
skipBackup: true,
path: 'images',
},
},
this.handleImagePickerResponse,
);
}; So the fix might be as simple as changing those options we pass to that The next steps for someone to try to resolve this would be to
|
We also just had another report that this didn't work on Android, with an interesting detail:
Maybe "send file" is what I used when I tried this earlier (#3624 (comment)) on Android and it worked for me? If so then that actually makes more sense -- I'd hope for this Anyway, the steps I posted just above still apply, except you can probably try either Android or iOS first before testing the change on the other. Either way, be sure to test you can reproduce the issue before adding a fix 🙂 |
Unfortunately, Fortunately, using it anyway it doesn't break anything – I've just tested |
We're now on 2.3.4 (with plans to upgrade further). Looks like the current |
Fixed in react-native-image-picker/react-native-image-picker@d55c53f, released in v4.4.0! 🎉 |
I've just filed react-native-image-picker/react-native-image-picker#1881 for another issue, then maybe it'll be simple? 🤞 |
@chrisbobbe Is this issue assigned to someone else or still open to work because as per above conversation , I'm unable to get that is it resolved or not? |
This issue has gotten stalled waiting for an upstream PR (current status here); I'd recommend choosing a different issue to work on. |
This comment was marked as off-topic.
This comment was marked as off-topic.
@Komal7209 please see https://zulip.readthedocs.io/en/latest/overview/contributing.html#picking-an-issue-to-work-on. I highly recommend reading through that entire page as you're getting started. Thanks! |
Another user request for this recently: |
Hey everyone I'm new to open-source can anyone guide me on how I can get started I just searched good first issue and got here I also forked zulip mobile repo |
Welcome @RealHarshAgarwal1 ! Please go through the Zulip contributor guide, as well as the mobile-specific instructions at https://github.com/zulip/zulip-mobile#contributing. |
Any update on this that can be provided? This is a major issue for us in adopting Zulip at the moment. Are there any workarounds via plugins for uploading videos? |
This has changes that look interesting for zulip#3624: react-native-image-picker/react-native-image-picker@fcb8aa641 (More details in an upcoming commit with our fix for that issue.) Also, a small change that should let us offer video capture on iOS: react-native-image-picker/react-native-image-picker@4de5e5a39 If we end up having to revert this upgrade because of something unrelated, that change should be easy to patch in with `patch-package`; see b546b07 for an example of using patch-package.
…13+) This issue was stalled while waiting for react-native-image-picker to include a filename extension in the `fileName` property of the asset payload, specifically in the case of videos on Android. We sent two PRs with reasonable approaches to do that, but they went stale: react-native-image-picker/react-native-image-picker#1881 react-native-image-picker/react-native-image-picker#1895 (We need appropriate filename extensions because Zulip servers want to interpret them.) But in January, a commit landed that actually added the filename extensions (!): react-native-image-picker/react-native-image-picker@fcb8aa641 Or at least, it added the extensions in the case where the Intent gives us a `content://` URL for the asset. (Note that the `.getExtensionFromMimeType` function call is added to `getFileTypeFromMime`, which is a helper for `getAppSpecificStorageUri`, which -- starting in that same commit -- is called for videos when the URL has `content://`.) We can guarantee getting a `content://` URL in at least the following way: restrict this feature to Android SDK 33+. As we know (and can confirm from reading code), the library uses Android's preferred new media-picker UI starting at that version: new Intent(MediaStore.ACTION_PICK_IMAGES) and the doc confirms that that indeed gives "content URI(s)": https://developer.android.com/reference/android/provider/MediaStore#ACTION_PICK_IMAGES It'd be nicer to allow video selection on older Android too. But that seems nontrivial, unless we can guarantee getting `content://` URLs from the ACTION_PICK intents created by this library, and I don't think we can. The alternative is a result we've rejected before: a bad, generic file-picker UI that's not specialized to images/videos, via a library codepath that uses Intent.ACTION_GET_CONTENT. Or I suppose I could basically rebase one of my library PRs I mentioned at the top of this commit message, so we'd get filename extensions irrespective of the `content://` detail. We wouldn't even have to wait for it to land; we found `patch-package` quite usable; see, e.g., b546b07. But at this point I think I've spent plenty of time on this, and the benefit of the current approach will be felt by a large and growing portion of our users. Fixes: zulip#3624
We've had another request for this: https://chat.zulip.org/#narrow/stream/48-mobile/topic/iOS.20issues/near/1611128 |
This has changes that look interesting for zulip#3624: react-native-image-picker/react-native-image-picker@fcb8aa641 (More details in an upcoming commit with our fix for that issue.) Also, a small change that should let us offer video capture on iOS: react-native-image-picker/react-native-image-picker@4de5e5a39 If we end up having to revert this upgrade because of something unrelated, that change should be easy to patch in with `patch-package`; see b546b07 for an example of using patch-package.
Only can upload photos. Can't upload any videos or other filetypes.
(even in the beta version, which I tried also)
[edit: this report was on iOS; edited title based on follow-up report in later comment.]
[edit: see below for a proposed solution that should hopefully be pretty easy?]
The text was updated successfully, but these errors were encountered: