aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-06-23 14:20:00 -0400
committerIvan Chen <ivan@tagg.id>2021-06-23 14:20:00 -0400
commit7e7a3ea6b6462d295717db052c37d87e1f58a091 (patch)
treea883dc7fad5a918ffc910f7a8b4ffca668b65525
parent25d1a6514c9df784df27d22da648340ae018c1f8 (diff)
Change to use image crop pickers instead
-rw-r--r--src/components/moments/Moment.tsx29
1 files changed, 11 insertions, 18 deletions
diff --git a/src/components/moments/Moment.tsx b/src/components/moments/Moment.tsx
index cd76f36c..cff99812 100644
--- a/src/components/moments/Moment.tsx
+++ b/src/components/moments/Moment.tsx
@@ -89,8 +89,9 @@ const Moment: React.FC<MomentProps> = ({
.then(async (vid) => {
if ('path' in vid) {
console.log(vid);
- if (vid.filename && vid.sourceURL) {
- uploadVideo(vid.sourceURL);
+ // vid.path is compressed mp4, vid.sourceURL is uncompressed original
+ if (vid.path) {
+ uploadVideo(vid.path);
}
}
})
@@ -177,22 +178,14 @@ const Moment: React.FC<MomentProps> = ({
{
text: 'camera (simulator will not work)',
onPress: () =>
- launchCamera(
- {
- mediaType: 'video',
- durationLimit: 60,
- },
- (response) => {
- console.log(response);
- if (
- response.assets &&
- response.assets.length !== 0 &&
- response.assets[0].uri
- ) {
- uploadVideo(response.assets[0].uri);
- }
- },
- ),
+ ImagePicker.openCamera({
+ mediaType: 'video',
+ }).then((vid) => {
+ console.log(vid);
+ if (vid.path) {
+ uploadVideo(vid.path);
+ }
+ }),
},
])
}