diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/utils/camera.ts | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/utils/camera.ts b/src/utils/camera.ts index 3937129a..3da5feaa 100644 --- a/src/utils/camera.ts +++ b/src/utils/camera.ts @@ -6,6 +6,7 @@ import { TakePictureOptions, TakePictureResponse, } from 'react-native-camera'; +import {ProcessingManager} from 'react-native-video-processing'; import ImagePicker, {Image, Video} from 'react-native-image-crop-picker'; import {ERROR_UPLOAD} from '../constants/strings'; @@ -62,6 +63,8 @@ export const navigateToVideoPicker = (callback: (vid: Video) => void) => { }) .then(async (vid) => { if (vid.path) { + ProcessingManager.compress(vid, options.compress) // like VideoPlayer compress options + .then((data: any) => console.log(data)); callback(vid); } }) @@ -72,6 +75,18 @@ export const navigateToVideoPicker = (callback: (vid: Video) => void) => { }); }; +const options = { + compress: { + width: 720, + height: 1280, + bitrateMultiplier: 3, + saveToCameraRoll: true, // default is false, iOS only + saveWithCurrentDate: true, // default is false, iOS only + minimumBitrate: 300000, + // removeAudio: true, // default is false + }, +}; + export const showGIFFailureAlert = (onSuccess: () => void) => Alert.alert( 'Warning', |