From 7e7a3ea6b6462d295717db052c37d87e1f58a091 Mon Sep 17 00:00:00 2001 From: Ivan Chen Date: Wed, 23 Jun 2021 14:20:00 -0400 Subject: Change to use image crop pickers instead --- src/components/moments/Moment.tsx | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) (limited to 'src') 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 = ({ .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 = ({ { 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); + } + }), }, ]) } -- cgit v1.2.3-70-g09d2