Skip to content

Commit ace4bb7

Browse files
committed
fix(getduration-signature): Changes the getDuration signature to getVideoDuration and removes media type input
1 parent 615d0d0 commit ace4bb7

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

example/src/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as React from 'react';
22

33
import { StyleSheet, View, Text, Button } from 'react-native';
44
import {
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

src/index.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)