react-native-video-trim 2.2.8 → 2.2.10
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
|
@@ -477,11 +477,18 @@ buildscript {
|
|
|
477
477
|
```
|
|
478
478
|
|
|
479
479
|
# Naming conflict with `ffmpeg-kit-react-native`
|
|
480
|
-
This issue is due to this package and `ffmpeg-kit-react-native`
|
|
480
|
+
This issue is due to this package and `ffmpeg-kit-react-native` have same ffmpegkit class name under the hood:
|
|
481
481
|
|
|
482
|
-
|
|
482
|
+
<img src="images/error_conflict_name.png"/>
|
|
483
483
|
|
|
484
|
-
|
|
484
|
+
To fix it we need to synchronize the FFMPEG Kit version of the 2 packages. For example: as shown in the image above, `ffmpeg-kit-react-native` uses `https`, version `6.0`, hence we need to run this:
|
|
485
|
+
```
|
|
486
|
+
FFMPEGKIT_PACKAGE=https FFMPEG_KIT_PACKAGE_VERSION=6.0 pod install
|
|
487
|
+
```
|
|
488
|
+
|
|
489
|
+
Another way to find out exactly FFMPEG Kit version that `ffmpeg-kit-react-native` using is to ([check here for package name](https://github.com/arthenica/ffmpeg-kit/blob/main/react-native/ffmpeg-kit-react-native.podspec#L19)) and package version is `version` in [package.json](https://github.com/arthenica/ffmpeg-kit/blob/main/react-native/package.json#L3)
|
|
490
|
+
|
|
491
|
+
When you know the package name + version, simply run `pod install` with `FFMPEGKIT_PACKAGE` and `FFMPEG_KIT_PACKAGE_VERSION` like above
|
|
485
492
|
|
|
486
493
|
# Thanks
|
|
487
494
|
- Android part is created by modified + fix bugs from: https://github.com/iknow4/Android-Video-Trimmer
|
|
@@ -266,8 +266,6 @@ public class VideoTrimmerView extends FrameLayout implements IVideoTrimmerView {
|
|
|
266
266
|
VideoTrimmerUtil.MAX_COUNT_RANGE = Math.max((VIDEO_FRAMES_WIDTH / VideoTrimmerUtil.mThumbWidth), VideoTrimmerUtil.MAX_COUNT_RANGE);
|
|
267
267
|
|
|
268
268
|
startShootVideoThumbs(mContext, VideoTrimmerUtil.MAX_COUNT_RANGE, 0, mDuration);
|
|
269
|
-
} else {
|
|
270
|
-
|
|
271
269
|
}
|
|
272
270
|
|
|
273
271
|
// Set initial handle positions if mMaxDuration < video duration
|
|
@@ -348,7 +346,9 @@ public class VideoTrimmerView extends FrameLayout implements IVideoTrimmerView {
|
|
|
348
346
|
|
|
349
347
|
public void onMediaPause() {
|
|
350
348
|
mTimingHandler.removeCallbacks(mTimingRunnable);
|
|
351
|
-
mediaPlayer.
|
|
349
|
+
if (mediaPlayer.isPlaying()) {
|
|
350
|
+
mediaPlayer.pause();
|
|
351
|
+
}
|
|
352
352
|
setPlayPauseViewIcon(false);
|
|
353
353
|
}
|
|
354
354
|
|
|
@@ -640,6 +640,7 @@ public class VideoTrimmerView extends FrameLayout implements IVideoTrimmerView {
|
|
|
640
640
|
|
|
641
641
|
private void setHandleTouchListener(View handle, boolean isLeading) {
|
|
642
642
|
handle.setOnTouchListener((view, event) -> {
|
|
643
|
+
boolean draggingDisabled = mDuration < mMinDuration; // if the video is shorter than the minimum duration, disable dragging
|
|
643
644
|
switch (event.getAction()) {
|
|
644
645
|
case MotionEvent.ACTION_DOWN:
|
|
645
646
|
currentSelectedhandle = handle;
|
|
@@ -650,6 +651,10 @@ public class VideoTrimmerView extends FrameLayout implements IVideoTrimmerView {
|
|
|
650
651
|
playHapticFeedback(true);
|
|
651
652
|
break;
|
|
652
653
|
case MotionEvent.ACTION_MOVE:
|
|
654
|
+
if (draggingDisabled) {
|
|
655
|
+
return false;
|
|
656
|
+
}
|
|
657
|
+
|
|
653
658
|
boolean didClamp = false;
|
|
654
659
|
float newX = event.getRawX() - ((float) view.getWidth() / 2);
|
|
655
660
|
if (isLeading) {
|