diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/components/moments/trimmer.tsx (renamed from src/utils/trimmer.tsx) | 31 | ||||
-rw-r--r-- | src/screens/moments/CameraScreen.tsx | 4 | ||||
-rw-r--r-- | src/screens/profile/CaptionScreen.tsx | 2 |
3 files changed, 30 insertions, 7 deletions
diff --git a/src/utils/trimmer.tsx b/src/components/moments/trimmer.tsx index 11d93ea8..ebf0d59e 100644 --- a/src/utils/trimmer.tsx +++ b/src/components/moments/trimmer.tsx @@ -18,7 +18,7 @@ export const TrimmerPlayer: React.FC<{source: string; styles: Object}> = ({ const [trackerTime, setTrackerTime] = useState<number>(0); useEffect(() => { if (!paused && (trackerTime >= end || trackerTime < start)) { - console.log('trackerTime reset start', start); + //console.log('trackerTime reset start', start); setTrackerTime(start); playerRef.current?.seek(start); } @@ -37,7 +37,7 @@ export const TrimmerPlayer: React.FC<{source: string; styles: Object}> = ({ const trim = () => { ProcessingManager.trim(source, { - startTime: start, + startTime: start / 2, //need to divide by two for bug in module endTime: end, saveToCameraRoll: true, // default is false // iOS only saveWithCurrentDate: true, // default is false // iOS only @@ -46,6 +46,29 @@ export const TrimmerPlayer: React.FC<{source: string; styles: Object}> = ({ .then((data: any) => console.log(data)); }; + /* + const [tempSource, setSource] = useState<string>(source); + const getCompressedVideo = () => { + console.log(source); + //ProcessingManager.getVideoInfo(source, (info) => console.log('info', info)); + + ProcessingManager.compress(source, { + 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 + }).then((data: string) => { + //console.log('compressed', data); + setSource(data); + }); + }; + useEffect(() => { + getCompressedVideo(); + }, []); */ + return ( <> <Video @@ -61,7 +84,7 @@ export const TrimmerPlayer: React.FC<{source: string; styles: Object}> = ({ repeat={true} // Repeat forever. //onLoadStart={this.loadStart} // Callback when video starts to load onLoad={(payload) => { - console.log(payload); + console.log(payload, source); setEnd(payload.duration); }} // Callback when video loads onProgress={(e) => { @@ -93,7 +116,7 @@ export const TrimmerPlayer: React.FC<{source: string; styles: Object}> = ({ themeColor={'white'} // iOS only showTrackerHandle={true} thumbWidth={10} // iOS only - trackerColor={'green'} // iOS only + trackerColor={'white'} // iOS only onChange={(e) => { //console.log('endsChange', e); setPaused(true); diff --git a/src/screens/moments/CameraScreen.tsx b/src/screens/moments/CameraScreen.tsx index 75638c40..7643f6ab 100644 --- a/src/screens/moments/CameraScreen.tsx +++ b/src/screens/moments/CameraScreen.tsx @@ -186,9 +186,9 @@ const CameraScreen: React.FC<CameraScreenProps> = ({route, navigation}) => { } else { // is this a video? if (media.duration !== null) { - navigateToCaptionScreen(true, media.path); + navigateToCaptionScreen(true, media.sourceURL); } else { - navigateToCropper(media.path); + navigateToCropper(media.sourceURL); } } }} diff --git a/src/screens/profile/CaptionScreen.tsx b/src/screens/profile/CaptionScreen.tsx index 4b5ac0c5..9816f1a3 100644 --- a/src/screens/profile/CaptionScreen.tsx +++ b/src/screens/profile/CaptionScreen.tsx @@ -42,7 +42,7 @@ import {RootState} from '../../store/rootReducer'; import {MomentTagType} from '../../types'; import {SCREEN_WIDTH, StatusBarHeight} from '../../utils'; import {mentionPartTypes} from '../../utils/comments'; -import {TrimmerPlayer} from '../../utils/trimmer'; +import {TrimmerPlayer} from '../../components/moments/trimmer'; /** * Upload Screen to allow users to upload posts to Tagg */ |