diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/utils/camera.ts | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/utils/camera.ts b/src/utils/camera.ts index 85bf8d73..ccdd42b0 100644 --- a/src/utils/camera.ts +++ b/src/utils/camera.ts @@ -8,13 +8,10 @@ import { TakePictureOptions, TakePictureResponse, } from 'react-native-camera'; -<<<<<<< HEAD import {ProcessingManager} from 'react-native-video-processing'; -import ImagePicker, {Image, Video} from 'react-native-image-crop-picker'; -======= import ImagePicker, {ImageOrVideo, Video} from 'react-native-image-crop-picker'; ->>>>>>> master import {ERROR_UPLOAD} from '../constants/strings'; +import RNFetchBlob from 'rn-fetch-blob'; /* * Captures a photo and pauses to show the preview of the picture taken @@ -72,8 +69,9 @@ export const navigateToImagePicker = ( mediaType: 'any', }) .then((media) => { - ProcessingManager.compress(media, options.compress) // like VideoPlayer compress options - .then((data: any) => console.log(data)); + const path: String = getVideoPath(media); + ProcessingManager.compress(path, options.compress) // like VideoPlayer compress options + .then((data: any) => console.log(data)); callback(media); }) .catch((err) => { @@ -83,13 +81,18 @@ export const navigateToImagePicker = ( }); }; +const getVideoPath = (uri) => { + console.log(uri); + return uri.path; +}; + export const navigateToVideoPicker = (callback: (vid: Video) => void) => { ImagePicker.openPicker({ mediaType: 'video', }) .then(async (vid) => { if (vid.path) { - ProcessingManager.compress(vid, options.compress) // like VideoPlayer compress options + ProcessingManager.compress(vid.path, options.compress) // like VideoPlayer compress options .then((data: any) => console.log(data)); callback(vid); } @@ -103,8 +106,8 @@ export const navigateToVideoPicker = (callback: (vid: Video) => void) => { const options = { compress: { - width: 720, - height: 1280, + width: 1080, + height: 1920, bitrateMultiplier: 3, saveToCameraRoll: true, // default is false, iOS only saveWithCurrentDate: true, // default is false, iOS only |