From 043c8adbed1914c191c6b87b78c3eb2a541bf8c4 Mon Sep 17 00:00:00 2001 From: Taner Sener Date: Sun, 2 Jan 2022 19:38:57 +0000 Subject: [PATCH] release v4.5.1 for flutter --- flutter/flutter/README.md | 24 +++++++++++++------ flutter/flutter/android/.gitignore | 2 +- .../src/ffmpeg_kit_flutter_initializer.dart | 4 ++-- flutter/flutter/pubspec.yaml | 2 +- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/flutter/flutter/README.md b/flutter/flutter/README.md index 4ef0979..3492b72 100644 --- a/flutter/flutter/README.md +++ b/flutter/flutter/README.md @@ -32,7 +32,7 @@ Add `ffmpeg_kit_flutter` as a dependency in your `pubspec.yaml file`. ```yaml dependencies: - ffmpeg_kit_flutter: ^4.5.1 + ffmpeg_kit_flutter: 4.5.1 ``` #### 2.1 Packages @@ -55,7 +55,7 @@ using the following dependency format. ```yaml dependencies: - ffmpeg_kit_flutter_: ^4.5.1 + ffmpeg_kit_flutter_: 4.5.1 ``` Note that hyphens in the package name must be replaced with underscores. Additionally, do not forget to use the package @@ -111,7 +111,7 @@ The following table shows the Android API level and iOS deployment target requir ```dart import 'package:ffmpeg_kit_flutter/ffmpeg_kit.dart'; - FFmpegKit.executeAsync('-i file1.mp4 -c:v mpeg4 file2.mp4', (session) async { + FFmpegKit.execute('-i file1.mp4 -c:v mpeg4 file2.mp4').then((session) async { final returnCode = await session.getReturnCode(); if (ReturnCode.isSuccess(returnCode)) { @@ -133,7 +133,7 @@ The following table shows the Android API level and iOS deployment target requir 2. Each `execute` call creates a new session. Access every detail about your execution from the session created. ```dart - FFmpegKit.executeAsync('-i file1.mp4 -c:v mpeg4 file2.mp4', (session) async { + FFmpegKit.execute('-i file1.mp4 -c:v mpeg4 file2.mp4').then((session) async { // Unique session id created for this execution final sessionId = session.getSessionId(); @@ -190,7 +190,7 @@ The following table shows the Android API level and iOS deployment target requir 4. Execute `FFprobe` commands. ```dart - FFprobeKit.executeAsync(ffprobeCommand, (session) { + FFprobeKit.execute(ffprobeCommand).then((session) async { // CALLED WHEN SESSION IS EXECUTED @@ -200,8 +200,18 @@ The following table shows the Android API level and iOS deployment target requir 5. Get media information for a file/url. ```dart - FFprobeKit.getMediaInformationAsync('', (session) async { - final information = await (session as MediaInformationSession).getMediaInformation(); + FFprobeKit.getMediaInformation('').then((session) async { + final information = await session.getMediaInformation(); + + if (information == null) { + + // CHECK THE FOLLOWING ATTRIBUTES ON ERROR + final state = FFmpegKitConfig.sessionStateToString(await session.getState()); + final returnCode = await session.getReturnCode(); + final failStackTrace = await session.getFailStackTrace(); + final duration = await session.getDuration(); + final output = await session.getOutput(); + } }); ``` diff --git a/flutter/flutter/android/.gitignore b/flutter/flutter/android/.gitignore index d3320fb..b5ad5b7 100644 --- a/flutter/flutter/android/.gitignore +++ b/flutter/flutter/android/.gitignore @@ -1,6 +1,6 @@ *.iml .gradle -/local.properties +local.properties /.idea/workspace.xml /.idea/libraries .DS_Store diff --git a/flutter/flutter/lib/src/ffmpeg_kit_flutter_initializer.dart b/flutter/flutter/lib/src/ffmpeg_kit_flutter_initializer.dart index a8d8628..6c54e21 100644 --- a/flutter/flutter/lib/src/ffmpeg_kit_flutter_initializer.dart +++ b/flutter/flutter/lib/src/ffmpeg_kit_flutter_initializer.dart @@ -19,8 +19,6 @@ import 'dart:io'; -import 'package:ffmpeg_kit_flutter/ffprobe_session.dart'; -import 'package:ffmpeg_kit_flutter/media_information_session.dart'; import 'package:ffmpeg_kit_flutter_platform_interface/ffmpeg_kit_flutter_platform_interface.dart'; import 'package:flutter/services.dart'; @@ -28,10 +26,12 @@ import '../arch_detect.dart'; import '../ffmpeg_kit_config.dart'; import '../ffmpeg_session.dart'; import '../ffmpeg_session_complete_callback.dart'; +import '../ffprobe_session.dart'; import '../ffprobe_session_complete_callback.dart'; import '../level.dart'; import '../log_callback.dart'; import '../log_redirection_strategy.dart'; +import '../media_information_session.dart'; import '../media_information_session_complete_callback.dart'; import '../packages.dart'; import '../session.dart'; diff --git a/flutter/flutter/pubspec.yaml b/flutter/flutter/pubspec.yaml index 39e5d01..203d365 100644 --- a/flutter/flutter/pubspec.yaml +++ b/flutter/flutter/pubspec.yaml @@ -21,7 +21,7 @@ flutter: pluginClass: FFmpegKitFlutterPlugin dependencies: - ffmpeg_kit_flutter_platform_interface: ^0.2.0 + ffmpeg_kit_flutter_platform_interface: ^0.2.1 flutter: sdk: flutter