react-native-video-trim 2.2.1 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -385,8 +385,8 @@ If there's error while loading media, there'll be a prompt
|
|
|
385
385
|
|
|
386
386
|
Related props: `alertOnFailToLoad, alertOnFailTitle, alertOnFailMessage, alertOnFailCloseText`
|
|
387
387
|
|
|
388
|
-
# FFMPEG
|
|
389
|
-
This library uses FFMPEG-Kit Android under the hood, by default FFMPEG
|
|
388
|
+
# Customize FFMPEG version
|
|
389
|
+
This library uses FFMPEG-Kit Android under the hood, by default FFMPEG `min` is used, which gives smallest bundle size. To customize the package version please see below
|
|
390
390
|
|
|
391
391
|
## Android
|
|
392
392
|
If you ever need to use other version of FFMPEG-Kit for Android, you can do the following, in your `android/build.gradle` > `buildscript` > `ext`:
|
|
@@ -415,6 +415,55 @@ FFMPEGKIT_PACKAGE_VERSION=5.1 npx pod-install ios
|
|
|
415
415
|
FFMPEGKIT_PACKAGE=full FFMPEGKIT_PACKAGE_VERSION=5.1 npx pod-install ios
|
|
416
416
|
```
|
|
417
417
|
|
|
418
|
+
## Packages
|
|
419
|
+
|
|
420
|
+
<table>
|
|
421
|
+
<thead>
|
|
422
|
+
<tr>
|
|
423
|
+
<th align="center"></th>
|
|
424
|
+
<th align="center"><sup>min</sup></th>
|
|
425
|
+
<th align="center"><sup>min-gpl</sup></th>
|
|
426
|
+
<th align="center"><sup>https</sup></th>
|
|
427
|
+
<th align="center"><sup>https-gpl</sup></th>
|
|
428
|
+
<th align="center"><sup>audio</sup></th>
|
|
429
|
+
<th align="center"><sup>video</sup></th>
|
|
430
|
+
<th align="center"><sup>full</sup></th>
|
|
431
|
+
<th align="center"><sup>full-gpl</sup></th>
|
|
432
|
+
</tr>
|
|
433
|
+
</thead>
|
|
434
|
+
<tbody>
|
|
435
|
+
<tr>
|
|
436
|
+
<td align="center"><sup>external libraries</sup></td>
|
|
437
|
+
<td align="center">-</td>
|
|
438
|
+
<td align="center"><sup>vid.stab</sup><br><sup>x264</sup><br><sup>x265</sup><br><sup>xvidcore</sup></td>
|
|
439
|
+
<td align="center"><sup>gmp</sup><br><sup>gnutls</sup></td>
|
|
440
|
+
<td align="center"><sup>gmp</sup><br><sup>gnutls</sup><br><sup>vid.stab</sup><br><sup>x264</sup><br><sup>x265</sup><br><sup>xvidcore</sup></td>
|
|
441
|
+
<td align="center"><sup>lame</sup><br><sup>libilbc</sup><br><sup>libvorbis</sup><br><sup>opencore-amr</sup><br><sup>opus</sup><br><sup>shine</sup><br><sup>soxr</sup><br><sup>speex</sup><br><sup>twolame</sup><br><sup>vo-amrwbenc</sup></td>
|
|
442
|
+
<td align="center"><sup>dav1d</sup><br><sup>fontconfig</sup><br><sup>freetype</sup><br><sup>fribidi</sup><br><sup>kvazaar</sup><br><sup>libass</sup><br><sup>libiconv</sup><br><sup>libtheora</sup><br><sup>libvpx</sup><br><sup>libwebp</sup><br><sup>snappy</sup><br><sup>zimg</sup></td>
|
|
443
|
+
<td align="center"><sup>dav1d</sup><br><sup>fontconfig</sup><br><sup>freetype</sup><br><sup>fribidi</sup><br><sup>gmp</sup><br><sup>gnutls</sup><br><sup>kvazaar</sup><br><sup>lame</sup><br><sup>libass</sup><br><sup>libiconv</sup><br><sup>libilbc</sup><br><sup>libtheora</sup><br><sup>libvorbis</sup><br><sup>libvpx</sup><br><sup>libwebp</sup><br><sup>libxml2</sup><br><sup>opencore-amr</sup><br><sup>opus</sup><br><sup>shine</sup><br><sup>snappy</sup><br><sup>soxr</sup><br><sup>speex</sup><br><sup>twolame</sup><br><sup>vo-amrwbenc</sup><br><sup>zimg</sup></td>
|
|
444
|
+
<td align="center"><sup>dav1d</sup><br><sup>fontconfig</sup><br><sup>freetype</sup><br><sup>fribidi</sup><br><sup>gmp</sup><br><sup>gnutls</sup><br><sup>kvazaar</sup><br><sup>lame</sup><br><sup>libass</sup><br><sup>libiconv</sup><br><sup>libilbc</sup><br><sup>libtheora</sup><br><sup>libvorbis</sup><br><sup>libvpx</sup><br><sup>libwebp</sup><br><sup>libxml2</sup><br><sup>opencore-amr</sup><br><sup>opus</sup><br><sup>shine</sup><br><sup>snappy</sup><br><sup>soxr</sup><br><sup>speex</sup><br><sup>twolame</sup><br><sup>vid.stab</sup><br><sup>vo-amrwbenc</sup><br><sup>x264</sup><br><sup>x265</sup><br><sup>xvidcore</sup><br><sup>zimg</sup></td>
|
|
445
|
+
</tr>
|
|
446
|
+
<tr>
|
|
447
|
+
<td align="center"><sup>android system libraries</sup></td>
|
|
448
|
+
<td align="center" colspan=8><sup>zlib</sup><br><sup>MediaCodec</sup></td>
|
|
449
|
+
</tr>
|
|
450
|
+
<tr>
|
|
451
|
+
<td align="center"><sup>ios system libraries</sup></td>
|
|
452
|
+
<td align="center" colspan=8><sup>bzip2</sup><br><sup>AudioToolbox</sup><br><sup>AVFoundation</sup><br><sup>iconv</sup><br><sup>VideoToolbox</sup><br><sup>zlib</sup></td>
|
|
453
|
+
</tr>
|
|
454
|
+
<tr>
|
|
455
|
+
<tr>
|
|
456
|
+
<td align="center"><sup>macos system libraries</sup></td>
|
|
457
|
+
<td align="center" colspan=8><sup>bzip2</sup><br><sup>AudioToolbox</sup><br><sup>AVFoundation</sup><br><sup>Core Image</sup><br><sup>iconv</sup><br><sup>OpenCL</sup><br><sup>OpenGL</sup><br><sup>VideoToolbox</sup><br><sup>zlib</sup></td>
|
|
458
|
+
</tr>
|
|
459
|
+
<tr>
|
|
460
|
+
<td align="center"><sup>tvos system libraries</sup></td>
|
|
461
|
+
<td align="center" colspan=8><sup>bzip2</sup><br><sup>AudioToolbox</sup><br><sup>iconv</sup><br><sup>VideoToolbox</sup><br><sup>zlib</sup></td>
|
|
462
|
+
</tr>
|
|
463
|
+
</tbody>
|
|
464
|
+
</table>
|
|
465
|
+
|
|
466
|
+
|
|
418
467
|
# Android: update SDK version
|
|
419
468
|
You can override sdk version to use any version in your `android/build.gradle` > `buildscript` > `ext`
|
|
420
469
|
```gradle
|
|
@@ -427,6 +476,13 @@ buildscript {
|
|
|
427
476
|
}
|
|
428
477
|
```
|
|
429
478
|
|
|
479
|
+
# Naming conflict with `ffmpeg-kit-react-native`
|
|
480
|
+
This issue is due to this package and `ffmpeg-kit-react-native` share FFMPEG Kit under the hood. To fix it we need to synchronize the FFMPEG Kit version of the 2 packages.
|
|
481
|
+
|
|
482
|
+
First find out exactly FFMPEG Kit version that `ffmpeg-kit-react-native` is using. By default (if you don't change), the ffmpeg package is `https` ([check here](https://github.com/arthenica/ffmpeg-kit/blob/main/react-native/ffmpeg-kit-react-native.podspec#L19)) and version is `version` in [package.json](https://github.com/arthenica/ffmpeg-kit/blob/main/react-native/package.json#L3)
|
|
483
|
+
|
|
484
|
+
When you know the package name + version, simply follow the section [Customize FFMPEG version](#customize-ffmpeg-version) in this doc
|
|
485
|
+
|
|
430
486
|
# Thanks
|
|
431
487
|
- Android part is created by modified + fix bugs from: https://github.com/iknow4/Android-Video-Trimmer
|
|
432
488
|
- iOS UI is created from: https://github.com/AndreasVerhoeven/VideoTrimmerControl
|
|
@@ -469,7 +469,10 @@ public class VideoTrimModule extends ReactContextBaseJavaModule implements Video
|
|
|
469
469
|
builder.setTitle(cancelTrimmingDialogTitle);
|
|
470
470
|
builder.setCancelable(false);
|
|
471
471
|
builder.setPositiveButton(cancelTrimmingDialogConfirmText, (dialog, which) -> {
|
|
472
|
-
trimmerView
|
|
472
|
+
if (trimmerView != null) {
|
|
473
|
+
// prevent trimmerView is null in some rare cases
|
|
474
|
+
trimmerView.onCancelTrimClicked();
|
|
475
|
+
}
|
|
473
476
|
|
|
474
477
|
if (mProgressDialog != null && mProgressDialog.isShowing()) {
|
|
475
478
|
mProgressDialog.dismiss();
|
|
@@ -481,7 +484,11 @@ public class VideoTrimModule extends ReactContextBaseJavaModule implements Video
|
|
|
481
484
|
cancelTrimmingConfirmDialog = builder.create();
|
|
482
485
|
cancelTrimmingConfirmDialog.show();
|
|
483
486
|
} else {
|
|
484
|
-
trimmerView
|
|
487
|
+
if (trimmerView != null) {
|
|
488
|
+
// prevent trimmerView is null in some rare cases
|
|
489
|
+
trimmerView.onCancelTrimClicked();
|
|
490
|
+
}
|
|
491
|
+
|
|
485
492
|
if (mProgressDialog != null && mProgressDialog.isShowing()) {
|
|
486
493
|
mProgressDialog.dismiss();
|
|
487
494
|
}
|