diff options
Diffstat (limited to 'src/screens/upload')
| -rw-r--r-- | src/screens/upload/EditMedia.tsx | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/screens/upload/EditMedia.tsx b/src/screens/upload/EditMedia.tsx index 1dc408ee..38450337 100644 --- a/src/screens/upload/EditMedia.tsx +++ b/src/screens/upload/EditMedia.tsx @@ -43,6 +43,7 @@ export const EditMedia: React.FC<EditMediaProps> = ({route, navigation}) => { const vidRef = useRef<View>(null); const [cropLoading, setCropLoading] = useState<boolean>(false); const [hideTrimmer, setHideTrimmer] = useState<boolean>(true); + const [videoDuration, setVideoDuration] = useState<number | undefined>(); // Stores the coordinates of the cropped image const [x0, setX0] = useState<number>(); @@ -139,7 +140,7 @@ export const EditMedia: React.FC<EditMediaProps> = ({route, navigation}) => { mediaUri, (croppedURL: string) => { setCropLoading(false); - // Pass the trimmed/cropped video + // Pass the cropped video callback(croppedURL); }, videoCrop, @@ -334,8 +335,12 @@ export const EditMedia: React.FC<EditMediaProps> = ({route, navigation}) => { height: SCREEN_WIDTH / aspectRatio, }, ]} - handleLoad={(response: {width: number; height: number}) => { + handleLoad={( + response: {width: number; height: number}, + duration: number, + ) => { const {width, height} = response; + setVideoDuration(duration); setOrigDimensions([width, height]); setAspectRatio(width / height); }} @@ -383,8 +388,9 @@ export const EditMedia: React.FC<EditMediaProps> = ({route, navigation}) => { navigation.navigate('CaptionScreen', { screenType, media: { - uri: uri, - isVideo: isVideo, + uri, + isVideo, + videoDuration, }, selectedCategory, }), |
