react-native-video-trim 2.2.7 → 2.2.9

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.
@@ -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.pause();
349
+ if (mediaPlayer.isPlaying()) {
350
+ mediaPlayer.pause();
351
+ }
352
352
  setPlayPauseViewIcon(false);
353
353
  }
354
354
 
@@ -522,8 +522,15 @@ public class VideoTrimmerView extends FrameLayout implements IVideoTrimmerView {
522
522
  @Override
523
523
  public void run() {
524
524
  try {
525
- updateCurrentTime(true);
526
- mTimingHandler.postDelayed(this, TIMING_UPDATE_INTERVAL);
525
+ int currentPosition = mediaPlayer.getCurrentPosition();
526
+
527
+ if (currentPosition >= endTime) {
528
+ onMediaPause();
529
+ seekTo(endTime, true); // Ensure exact end time display
530
+ } else {
531
+ updateCurrentTime(true);
532
+ mTimingHandler.postDelayed(this, TIMING_UPDATE_INTERVAL);
533
+ }
527
534
  } catch (IllegalStateException e) {
528
535
  e.printStackTrace();
529
536
  mTimingHandler.removeCallbacks(mTimingRunnable);
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Workspace
3
+ version = "1.0">
4
+ </Workspace>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-video-trim",
3
- "version": "2.2.7",
3
+ "version": "2.2.9",
4
4
  "description": "Video trimmer for your React Native app",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",