diff options
author | Ivan Chen <ivan@tagg.id> | 2021-06-23 17:01:42 -0400 |
---|---|---|
committer | Ivan Chen <ivan@tagg.id> | 2021-06-23 17:01:42 -0400 |
commit | 66dcf88ab09fbd73e234e209e270e2b31c867247 (patch) | |
tree | a1fe16d752ee6c7847311a0e94e69660b37a0592 /src/components | |
parent | f3651f53af4bf2a7163c82bb8c21bc6ec3940b4e (diff) |
Cleanup code, Add support for video tagging
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/moments/Moment.tsx | 33 |
1 files changed, 12 insertions, 21 deletions
diff --git a/src/components/moments/Moment.tsx b/src/components/moments/Moment.tsx index a0f66cc5..6441bca3 100644 --- a/src/components/moments/Moment.tsx +++ b/src/components/moments/Moment.tsx @@ -55,28 +55,19 @@ const Moment: React.FC<MomentProps> = ({ */ const navigateToVideoPicker = () => { ImagePicker.openPicker({ - smartAlbums: [ - 'Favorites', - 'RecentlyAdded', - 'SelfPortraits', - 'Screenshots', - 'UserLibrary', - ], - width: 580, - height: 580, - cropping: false, - cropperToolbarTitle: 'select a video', mediaType: 'video', }) .then(async (vid) => { - if ('path' in vid) { - let fileName = vid.filename || ''; - if (fileName.endsWith('.heic') || fileName.endsWith('.HEIC')) { - fileName = fileName.split('.')[0] + '.jpg'; - } - let presignedURL = await handlePresignedURL(fileName, title); - console.log('presigned' + JSON.stringify(presignedURL)); - handleVideoUpload(vid, presignedURL); + if (vid.path) { + navigation.navigate('CaptionScreen', { + screenType, + title, + media: { + filename: `poc_${Math.random().toString(36).substring(7)}.mov`, + uri: vid.path, + isVideo: true, + }, + }); } }) .catch((err) => { @@ -105,11 +96,11 @@ const Moment: React.FC<MomentProps> = ({ if (picture.path && picture.filename) { navigation.navigate('CaptionScreen', { screenType, - title: title, + title, media: { filename: picture.filename, uri: picture.path, - type: 'image', + isVideo: false, }, }); } |