@@ -32,7 +32,7 @@ Add `ffmpeg_kit_flutter` as a dependency in your `pubspec.yaml file`.
32
32
33
33
``` yaml
34
34
dependencies :
35
- ffmpeg_kit_flutter : ^ 4.5.1
35
+ ffmpeg_kit_flutter : 4.5.1
36
36
` ` `
37
37
38
38
#### 2.1 Packages
@@ -55,7 +55,7 @@ using the following dependency format.
55
55
56
56
` ` ` yaml
57
57
dependencies:
58
- ffmpeg_kit_flutter_<package name>: ^ 4.5.1
58
+ ffmpeg_kit_flutter_<package name>: 4.5.1
59
59
` ` `
60
60
61
61
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
111
111
` ` ` dart
112
112
import 'package:ffmpeg_kit_flutter/ffmpeg_kit.dart';
113
113
114
- FFmpegKit.executeAsync ('-i file1.mp4 -c:v mpeg4 file2.mp4', (session) async {
114
+ FFmpegKit.execute ('-i file1.mp4 -c:v mpeg4 file2.mp4').then( (session) async {
115
115
final returnCode = await session.getReturnCode();
116
116
117
117
if (ReturnCode.isSuccess(returnCode)) {
@@ -133,7 +133,7 @@ The following table shows the Android API level and iOS deployment target requir
133
133
2. Each `execute` call creates a new session. Access every detail about your execution from the session created.
134
134
135
135
` ` ` dart
136
- FFmpegKit.executeAsync ('-i file1.mp4 -c:v mpeg4 file2.mp4', (session) async {
136
+ FFmpegKit.execute ('-i file1.mp4 -c:v mpeg4 file2.mp4').then( (session) async {
137
137
138
138
// Unique session id created for this execution
139
139
final sessionId = session.getSessionId();
@@ -190,7 +190,7 @@ The following table shows the Android API level and iOS deployment target requir
190
190
4. Execute `FFprobe` commands.
191
191
192
192
` ` ` dart
193
- FFprobeKit.executeAsync (ffprobeCommand, ( session) {
193
+ FFprobeKit.execute (ffprobeCommand).then(( session) async {
194
194
195
195
// CALLED WHEN SESSION IS EXECUTED
196
196
@@ -200,8 +200,18 @@ The following table shows the Android API level and iOS deployment target requir
200
200
5. Get media information for a file/url.
201
201
202
202
` ` ` dart
203
- FFprobeKit.getMediaInformationAsync('<file path or url>', (session) async {
204
- final information = await (session as MediaInformationSession).getMediaInformation();
203
+ FFprobeKit.getMediaInformation('<file path or url>').then((session) async {
204
+ final information = await session.getMediaInformation();
205
+
206
+ if (information == null) {
207
+
208
+ // CHECK THE FOLLOWING ATTRIBUTES ON ERROR
209
+ final state = FFmpegKitConfig.sessionStateToString(await session.getState());
210
+ final returnCode = await session.getReturnCode();
211
+ final failStackTrace = await session.getFailStackTrace();
212
+ final duration = await session.getDuration();
213
+ final output = await session.getOutput();
214
+ }
205
215
});
206
216
` ` `
207
217
0 commit comments