File tree Expand file tree Collapse file tree 2 files changed +3
-7
lines changed Expand file tree Collapse file tree 2 files changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import * as React from 'react';
22
33import { StyleSheet , View , Text , Button } from 'react-native' ;
44import {
5- getDuration ,
5+ getVideoDuration ,
66 getDimensions ,
77 getMimeType ,
88 getTimestamp ,
@@ -40,7 +40,7 @@ export default function App() {
4040 console . log ( 'Results from @qeepsake/react-native-file-utils:' ) ;
4141 console . log ( '-------------' ) ;
4242
43- const duration = await getDuration ( uri , mediaType ) ;
43+ const duration = await getVideoDuration ( uri ) ;
4444 console . log ( 'duration:' ) ;
4545 console . log ( duration ) ;
4646
Original file line number Diff line number Diff line change @@ -24,11 +24,7 @@ const FileUtils = NativeModules.FileUtils
2424 * @param uri The full on device uri for the media item.
2525 * @returns Duration of the video in number of seconds.
2626 */
27- export async function getDuration (
28- uri : string ,
29- mediaType : 'video' | 'image'
30- ) : Promise < number > {
31- if ( mediaType !== 'video' ) return 0 ;
27+ export async function getVideoDuration ( uri : string ) : Promise < number > {
3228 return FileUtils . getDuration ( uri ) ;
3329}
3430
You can’t perform that action at this time.
0 commit comments