From b02d3440c305608a8e20f8676f0c6b42abe14356 Mon Sep 17 00:00:00 2001 From: Taner Sener Date: Sun, 2 Jan 2022 11:23:41 +0000 Subject: [PATCH] release v4.5.1 for react-native --- react-native/README.md | 18 ++++++++++++++---- react-native/package.json | 11 ----------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/react-native/README.md b/react-native/README.md index 6d4c8ce..c178125 100644 --- a/react-native/README.md +++ b/react-native/README.md @@ -196,7 +196,7 @@ compare to each other. ```js import { FFmpegKit } from 'ffmpeg-kit-react-native'; - FFmpegKit.executeAsync('-i file1.mp4 -c:v mpeg4 file2.mp4', async (session) => { + FFmpegKit.execute('-i file1.mp4 -c:v mpeg4 file2.mp4').then(async (session) => { const returnCode = await session.getReturnCode(); if (ReturnCode.isSuccess(returnCode)) { @@ -219,7 +219,7 @@ compare to each other. session created. ```js - FFmpegKit.executeAsync('-i file1.mp4 -c:v mpeg4 file2.mp4').then(async (session) => { + FFmpegKit.execute('-i file1.mp4 -c:v mpeg4 file2.mp4').then(async (session) => { // Unique session id created for this execution const sessionId = session.getSessionId(); @@ -276,7 +276,7 @@ compare to each other. 4. Execute `FFprobe` commands. ```js - FFprobeKit.executeAsync(ffprobeCommand, session => { + FFprobeKit.execute(ffprobeCommand).then(async (session) => { // CALLED WHEN SESSION IS EXECUTED @@ -286,8 +286,18 @@ compare to each other. 5. Get media information for a file/url. ```js - FFprobeKit.getMediaInformationAsync('', async (session) => { + FFprobeKit.getMediaInformation(testUrl).then(async (session) => { const information = await session.getMediaInformation(); + + if (information === undefined) { + + // CHECK THE FOLLOWING ATTRIBUTES ON ERROR + const state = FFmpegKitConfig.sessionStateToString(await session.getState()); + const returnCode = await session.getReturnCode(); + const failStackTrace = await session.getFailStackTrace(); + const duration = await session.getDuration(); + const output = await session.getOutput(); + } }); ``` diff --git a/react-native/package.json b/react-native/package.json index e5fc263..7e72211 100644 --- a/react-native/package.json +++ b/react-native/package.json @@ -6,17 +6,6 @@ "types": "src/index.d.ts", "react-native": "src/index", "source": "src/index", - "files": [ - "android", - "ffmpeg-kit-react-native.podspec", - "ios", - "src", - "!android/build", - "!ios/build", - "!**/__tests__", - "!**/__fixtures__", - "!**/__mocks__" - ], "scripts": { "test": "jest", "lint": "eslint \"**/*.{js,ts,tsx}\"",