react-native-video-trim 6.0.1 → 6.0.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 +485 -444
- package/android/src/main/java/com/videotrim/widgets/VideoTrimmerView.java +44 -0
- package/android/src/main/res/layout/video_trimmer_view.xml +7 -7
- package/android/src/main/res/values/strings.xml +1 -0
- package/ios/VideoTrim.mm +11 -2
- package/ios/VideoTrimmer.swift +2 -2
- package/ios/VideoTrimmerThumb.swift +14 -1
- package/ios/VideoTrimmerViewController.swift +37 -63
- package/lib/module/NativeVideoTrim.js.map +1 -1
- package/lib/module/index.js +11 -3
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/NativeVideoTrim.d.ts +8 -0
- package/lib/typescript/src/NativeVideoTrim.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +3 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/NativeVideoTrim.ts +8 -0
- package/src/index.tsx +14 -4
|
@@ -123,6 +123,11 @@ public class VideoTrimmerView extends FrameLayout implements IVideoTrimmerView {
|
|
|
123
123
|
|
|
124
124
|
private RelativeLayout trimmerView;
|
|
125
125
|
|
|
126
|
+
private int trimmerColor = Color.parseColor(getContext().getString(R.string.trim_color)); // Default color if not set
|
|
127
|
+
private int handleIconColor = Color.BLACK; // Default chevron color
|
|
128
|
+
private ImageView leadingChevron;
|
|
129
|
+
private ImageView trailingChevron;
|
|
130
|
+
|
|
126
131
|
public VideoTrimmerView(ReactApplicationContext context, ReadableMap config, AttributeSet attrs) {
|
|
127
132
|
this(context, attrs, 0, config);
|
|
128
133
|
}
|
|
@@ -174,6 +179,9 @@ public class VideoTrimmerView extends FrameLayout implements IVideoTrimmerView {
|
|
|
174
179
|
headerText = findViewById(R.id.headerText);
|
|
175
180
|
|
|
176
181
|
trimmerView = findViewById(R.id.trimmerView);
|
|
182
|
+
|
|
183
|
+
leadingChevron = findViewById(R.id.leadingChevron);
|
|
184
|
+
trailingChevron = findViewById(R.id.trailingChevron);
|
|
177
185
|
}
|
|
178
186
|
|
|
179
187
|
public void initByURI(final Uri videoURI) {
|
|
@@ -498,6 +506,42 @@ public class VideoTrimmerView extends FrameLayout implements IVideoTrimmerView {
|
|
|
498
506
|
alertOnFailCloseText = config.hasKey("alertOnFailCloseText") ? config.getString("alertOnFailCloseText") : "Close";
|
|
499
507
|
enableRotation = config.hasKey("enableRotation") && config.getBoolean("enableRotation");
|
|
500
508
|
rotationAngle = config.hasKey("rotationAngle") ? config.getDouble("rotationAngle") : 0.0;
|
|
509
|
+
|
|
510
|
+
trimmerColor = config.hasKey("trimmerColor") ? config.getInt("trimmerColor") : Color.parseColor(getContext().getString(R.string.trim_color));
|
|
511
|
+
handleIconColor = config.hasKey("handleIconColor") ? config.getInt("handleIconColor") : Color.BLACK;
|
|
512
|
+
|
|
513
|
+
applyTrimmerColor();
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
private void applyTrimmerColor() {
|
|
517
|
+
// Trimmer border (stroke only)
|
|
518
|
+
GradientDrawable borderDrawable = new GradientDrawable();
|
|
519
|
+
borderDrawable.setShape(GradientDrawable.RECTANGLE);
|
|
520
|
+
borderDrawable.setColor(Color.TRANSPARENT);
|
|
521
|
+
borderDrawable.setStroke(dpToPx(4), trimmerColor);
|
|
522
|
+
trimmerContainer.setBackground(borderDrawable);
|
|
523
|
+
|
|
524
|
+
// Leading handle (rounded left corners)
|
|
525
|
+
GradientDrawable leadingHandleDrawable = new GradientDrawable();
|
|
526
|
+
leadingHandleDrawable.setShape(GradientDrawable.RECTANGLE);
|
|
527
|
+
leadingHandleDrawable.setColor(trimmerColor);
|
|
528
|
+
leadingHandleDrawable.setCornerRadii(new float[]{dpToPx(6), dpToPx(6), 0, 0, 0, 0, dpToPx(6), dpToPx(6)});
|
|
529
|
+
leadingHandle.setBackground(leadingHandleDrawable);
|
|
530
|
+
|
|
531
|
+
// Trailing handle (rounded right corners)
|
|
532
|
+
GradientDrawable trailingHandleDrawable = new GradientDrawable();
|
|
533
|
+
trailingHandleDrawable.setShape(GradientDrawable.RECTANGLE);
|
|
534
|
+
trailingHandleDrawable.setColor(trimmerColor);
|
|
535
|
+
trailingHandleDrawable.setCornerRadii(new float[]{0, 0, dpToPx(6), dpToPx(6), dpToPx(6), dpToPx(6), 0, 0});
|
|
536
|
+
trailingHandle.setBackground(trailingHandleDrawable);
|
|
537
|
+
|
|
538
|
+
// Chevron colors
|
|
539
|
+
leadingChevron.setColorFilter(handleIconColor, android.graphics.PorterDuff.Mode.SRC_IN);
|
|
540
|
+
trailingChevron.setColorFilter(handleIconColor, android.graphics.PorterDuff.Mode.SRC_IN);
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
private int dpToPx(int dp) {
|
|
544
|
+
return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, getResources().getDisplayMetrics());
|
|
501
545
|
}
|
|
502
546
|
|
|
503
547
|
private void startTimingRunnable() {
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
android:layout_height="match_parent"
|
|
112
112
|
android:layout_toStartOf="@id/trailingOverlay"
|
|
113
113
|
android:layout_toEndOf="@id/leadingOverlay"
|
|
114
|
-
android:background="@
|
|
114
|
+
android:background="@android:color/transparent" />
|
|
115
115
|
|
|
116
116
|
<View
|
|
117
117
|
android:id="@+id/progressIndicator"
|
|
@@ -134,15 +134,15 @@
|
|
|
134
134
|
android:layout_height="match_parent"
|
|
135
135
|
android:layout_alignParentStart="true"
|
|
136
136
|
android:layout_centerVertical="true"
|
|
137
|
-
android:background="@
|
|
137
|
+
android:background="@android:color/transparent"
|
|
138
138
|
android:paddingVertical="10dp">
|
|
139
139
|
|
|
140
140
|
<ImageView
|
|
141
|
+
android:id="@+id/leadingChevron"
|
|
141
142
|
android:layout_width="20dp"
|
|
142
143
|
android:layout_height="match_parent"
|
|
143
144
|
android:contentDescription="LeadingHandle"
|
|
144
|
-
android:src="@drawable/chevron_compact_left"
|
|
145
|
-
android:tint="@color/black" />
|
|
145
|
+
android:src="@drawable/chevron_compact_left" />
|
|
146
146
|
</FrameLayout>
|
|
147
147
|
|
|
148
148
|
<FrameLayout
|
|
@@ -151,15 +151,15 @@
|
|
|
151
151
|
android:layout_height="match_parent"
|
|
152
152
|
android:layout_alignParentEnd="true"
|
|
153
153
|
android:layout_centerVertical="true"
|
|
154
|
-
android:background="@
|
|
154
|
+
android:background="@android:color/transparent"
|
|
155
155
|
android:paddingVertical="10dp">
|
|
156
156
|
|
|
157
157
|
<ImageView
|
|
158
|
+
android:id="@+id/trailingChevron"
|
|
158
159
|
android:layout_width="20dp"
|
|
159
160
|
android:layout_height="match_parent"
|
|
160
161
|
android:contentDescription="TrailingHandle"
|
|
161
|
-
android:src="@drawable/chevron_compact_right"
|
|
162
|
-
android:tint="@color/black" />
|
|
162
|
+
android:src="@drawable/chevron_compact_right" />
|
|
163
163
|
</FrameLayout>
|
|
164
164
|
|
|
165
165
|
</RelativeLayout>
|
package/ios/VideoTrim.mm
CHANGED
|
@@ -16,7 +16,6 @@ RCT_EXPORT_MODULE()
|
|
|
16
16
|
|
|
17
17
|
- (instancetype)init {
|
|
18
18
|
if (self = [super init]) {
|
|
19
|
-
// self.BEFORE_TRIM_PREFIX = @"beforeTrim";
|
|
20
19
|
}
|
|
21
20
|
return self;
|
|
22
21
|
}
|
|
@@ -143,6 +142,17 @@ RCT_EXPORT_MODULE()
|
|
|
143
142
|
dict[@"alertOnFailMessage"] = config.alertOnFailMessage();
|
|
144
143
|
dict[@"alertOnFailCloseText"] = config.alertOnFailCloseText();
|
|
145
144
|
|
|
145
|
+
// Handle optional color values
|
|
146
|
+
auto trimmerColorOpt = config.trimmerColor();
|
|
147
|
+
if (trimmerColorOpt.has_value()) {
|
|
148
|
+
dict[@"trimmerColor"] = @(trimmerColorOpt.value());
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
auto handleIconColorOpt = config.handleIconColor();
|
|
152
|
+
if (handleIconColorOpt.has_value()) {
|
|
153
|
+
dict[@"handleIconColor"] = @(handleIconColorOpt.value());
|
|
154
|
+
}
|
|
155
|
+
|
|
146
156
|
[self->videoTrim showEditor:filePath withConfig:dict];
|
|
147
157
|
}
|
|
148
158
|
|
|
@@ -209,4 +219,3 @@ RCT_EXTERN_METHOD(trim:(NSString*)uri withConfig:(NSDictionary *)config
|
|
|
209
219
|
@end
|
|
210
220
|
|
|
211
221
|
#endif
|
|
212
|
-
|
package/ios/VideoTrimmer.swift
CHANGED
|
@@ -34,7 +34,7 @@ import AVFoundation
|
|
|
34
34
|
|
|
35
35
|
// currently there're warnings in the console saying that initial width of thumbView is 0
|
|
36
36
|
// TODO: migrate all to AutoLayout
|
|
37
|
-
|
|
37
|
+
let thumbView: VideoTrimmerThumb = {
|
|
38
38
|
let view = VideoTrimmerThumb()
|
|
39
39
|
view.accessibilityIdentifier = "thumbView"
|
|
40
40
|
return view
|
|
@@ -869,4 +869,4 @@ fileprivate extension CGSize {
|
|
|
869
869
|
func applyingVideoTransform(_ transform: CGAffineTransform) -> CGSize {
|
|
870
870
|
return CGRect(origin: .zero, size: self).applying(transform).size
|
|
871
871
|
}
|
|
872
|
-
}
|
|
872
|
+
}
|
|
@@ -172,4 +172,17 @@ class VideoTrimmerThumb: UIView {
|
|
|
172
172
|
topView.backgroundColor = color
|
|
173
173
|
bottomView.backgroundColor = color
|
|
174
174
|
}
|
|
175
|
-
|
|
175
|
+
|
|
176
|
+
// MARK: - Public Color Update Methods
|
|
177
|
+
func updateTrimmerColor(_ color: UIColor) {
|
|
178
|
+
leadingView.backgroundColor = color
|
|
179
|
+
trailingView.backgroundColor = color
|
|
180
|
+
topView.backgroundColor = color
|
|
181
|
+
bottomView.backgroundColor = color
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
func updateHandleIconColor(_ color: UIColor) {
|
|
185
|
+
leadingChevronImageView.tintColor = color
|
|
186
|
+
trailingChevronView.tintColor = color
|
|
187
|
+
}
|
|
188
|
+
}
|
|
@@ -48,6 +48,10 @@ class VideoTrimmerViewController: UIViewController {
|
|
|
48
48
|
var saveBtnClicked: ((CMTimeRange) -> Void)?
|
|
49
49
|
private var enableHapticFeedback = true
|
|
50
50
|
|
|
51
|
+
// New color properties
|
|
52
|
+
private var trimmerColor: UIColor = UIColor.systemYellow
|
|
53
|
+
private var handleIconColor: UIColor = UIColor.black
|
|
54
|
+
|
|
51
55
|
private let playerController = AVPlayerViewController()
|
|
52
56
|
private var trimmer: VideoTrimmer!
|
|
53
57
|
private var timingStackView: UIStackView!
|
|
@@ -220,6 +224,17 @@ class VideoTrimmerViewController: UIViewController {
|
|
|
220
224
|
cancelBtnClicked?()
|
|
221
225
|
}
|
|
222
226
|
|
|
227
|
+
// MARK: - Color Update Methods
|
|
228
|
+
private func applyTrimmerColors() {
|
|
229
|
+
guard let trimmer = trimmer else { return }
|
|
230
|
+
|
|
231
|
+
// Apply trimmer color to the thumb view
|
|
232
|
+
trimmer.thumbView.updateTrimmerColor(trimmerColor)
|
|
233
|
+
|
|
234
|
+
// Apply handle icon color to the chevron image views
|
|
235
|
+
trimmer.thumbView.updateHandleIconColor(handleIconColor)
|
|
236
|
+
}
|
|
237
|
+
|
|
223
238
|
// MARK: - Setup Methods
|
|
224
239
|
private func setupView() {
|
|
225
240
|
self.overrideUserInterfaceStyle = .dark
|
|
@@ -350,6 +365,9 @@ class VideoTrimmerViewController: UIViewController {
|
|
|
350
365
|
UIView.animate(withDuration: 0.25, animations: {
|
|
351
366
|
self.trimmer.alpha = 1
|
|
352
367
|
})
|
|
368
|
+
|
|
369
|
+
// Apply the trimmer colors
|
|
370
|
+
applyTrimmerColors()
|
|
353
371
|
}
|
|
354
372
|
|
|
355
373
|
private func setupPlayerController() {
|
|
@@ -447,46 +465,25 @@ class VideoTrimmerViewController: UIViewController {
|
|
|
447
465
|
}
|
|
448
466
|
|
|
449
467
|
public func configure(config: NSDictionary) {
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
if let
|
|
463
|
-
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
if let enableHaptic = config["enableHapticFeedback"] as? Bool {
|
|
471
|
-
enableHapticFeedback = enableHaptic
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
if let autoPlay = config["autoplay"] as? Bool {
|
|
475
|
-
autoplay = autoPlay
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
if let headerText = config["headerText"] as? String, !headerText.isEmpty {
|
|
479
|
-
self.headerText = headerText
|
|
480
|
-
|
|
481
|
-
if let textSize = config["headerTextSize"] as? Int, textSize > 0 {
|
|
482
|
-
headerTextSize = textSize
|
|
483
|
-
}
|
|
484
|
-
|
|
485
|
-
if let textColor = config["headerTextColor"] as? Double {
|
|
486
|
-
headerTextColor = textColor
|
|
487
|
-
}
|
|
488
|
-
}
|
|
489
|
-
}
|
|
468
|
+
maximumDuration = config["maxDuration"] as? Int ?? 0
|
|
469
|
+
minimumDuration = config["minDuration"] as? Int ?? 0
|
|
470
|
+
cancelButtonText = config["cancelButtonText"] as? String ?? "Cancel"
|
|
471
|
+
saveButtonText = config["saveButtonText"] as? String ?? "Save"
|
|
472
|
+
jumpToPositionOnLoad = config["jumpToPositionOnLoad"] as? Double ?? 0
|
|
473
|
+
enableHapticFeedback = config["enableHapticFeedback"] as? Bool ?? true
|
|
474
|
+
autoplay = config["autoplay"] as? Bool ?? false
|
|
475
|
+
headerText = config["headerText"] as? String
|
|
476
|
+
headerTextSize = config["headerTextSize"] as? Int ?? 16
|
|
477
|
+
headerTextColor = config["headerTextColor"] as? Double
|
|
478
|
+
|
|
479
|
+
// Handle new color properties
|
|
480
|
+
if let trimmerColorValue = config["trimmerColor"] as? Double {
|
|
481
|
+
trimmerColor = RCTConvert.uiColor(trimmerColorValue) ?? UIColor.systemYellow
|
|
482
|
+
}
|
|
483
|
+
if let handleIconColorValue = config["handleIconColor"] as? Double {
|
|
484
|
+
handleIconColor = RCTConvert.uiColor(handleIconColorValue) ?? UIColor.black
|
|
485
|
+
}
|
|
486
|
+
}
|
|
490
487
|
|
|
491
488
|
override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
|
|
492
489
|
if keyPath == "status" {
|
|
@@ -553,26 +550,3 @@ private extension UILabel {
|
|
|
553
550
|
return label
|
|
554
551
|
}
|
|
555
552
|
}
|
|
556
|
-
|
|
557
|
-
//extension UIColor {
|
|
558
|
-
// static func color(fromHexNumber hex: NSNumber?, defaultColor: UIColor = .black) -> UIColor {
|
|
559
|
-
// guard let hexValue = hex?.int32Value else {
|
|
560
|
-
// return defaultColor
|
|
561
|
-
// }
|
|
562
|
-
//
|
|
563
|
-
// // Extract RGB components from the hex value
|
|
564
|
-
// let red = CGFloat((hexValue >> 16) & 0xFF) / 255.0 // Extract red (bits 16-23)
|
|
565
|
-
// let green = CGFloat((hexValue >> 8) & 0xFF) / 255.0 // Extract green (bits 8-15)
|
|
566
|
-
// let blue = CGFloat(hexValue & 0xFF) / 255.0 // Extract blue (bits 0-7)
|
|
567
|
-
//
|
|
568
|
-
// // Check if alpha is included (if hex is 0xAARRGGBB)
|
|
569
|
-
// let alpha: CGFloat
|
|
570
|
-
// if hexValue > 0xFFFFFF { // If the value is larger than 0xFFFFFF, it includes alpha
|
|
571
|
-
// alpha = CGFloat((hexValue >> 24) & 0xFF) / 255.0 // Extract alpha (bits 24-31)
|
|
572
|
-
// } else {
|
|
573
|
-
// alpha = 1.0 // Default to opaque
|
|
574
|
-
// }
|
|
575
|
-
//
|
|
576
|
-
// return UIColor(red: red, green: green, blue: blue, alpha: alpha)
|
|
577
|
-
// }
|
|
578
|
-
//}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeVideoTrim.ts"],"mappings":";;AACA,SAASA,mBAAmB,QAAQ,cAAc;
|
|
1
|
+
{"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeVideoTrim.ts"],"mappings":";;AACA,SAASA,mBAAmB,QAAQ,cAAc;AA4HlD,eAAeA,mBAAmB,CAACC,YAAY,CAAO,WAAW,CAAC","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
|
@@ -57,6 +57,8 @@ function createEditorConfig(overrides = {}) {
|
|
|
57
57
|
headerText: '',
|
|
58
58
|
headerTextSize: 16,
|
|
59
59
|
headerTextColor: processColor('white'),
|
|
60
|
+
trimmerColor: processColor('#f1d247'),
|
|
61
|
+
handleIconColor: processColor('black'),
|
|
60
62
|
alertOnFailToLoad: true,
|
|
61
63
|
alertOnFailTitle: 'Error',
|
|
62
64
|
alertOnFailMessage: 'Fail to load media. Possibly invalid file or no network connection',
|
|
@@ -84,12 +86,18 @@ function createTrimOptions(overrides = {}) {
|
|
|
84
86
|
*/
|
|
85
87
|
export function showEditor(filePath, config) {
|
|
86
88
|
const {
|
|
87
|
-
headerTextColor
|
|
89
|
+
headerTextColor,
|
|
90
|
+
trimmerColor,
|
|
91
|
+
handleIconColor
|
|
88
92
|
} = config;
|
|
89
|
-
const
|
|
93
|
+
const _headerTextColor = processColor(headerTextColor || 'white');
|
|
94
|
+
const _trimmerColor = processColor(trimmerColor || '#f1d247');
|
|
95
|
+
const _handleIconColor = processColor(handleIconColor || 'black');
|
|
90
96
|
VideoTrim.showEditor(filePath, createEditorConfig({
|
|
91
97
|
...config,
|
|
92
|
-
headerTextColor:
|
|
98
|
+
headerTextColor: _headerTextColor,
|
|
99
|
+
trimmerColor: _trimmerColor,
|
|
100
|
+
handleIconColor: _handleIconColor
|
|
93
101
|
}));
|
|
94
102
|
}
|
|
95
103
|
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["VideoTrimNewArch","VideoTrimOldArch","processColor","isFabric","global","nativeFabricUIManager","VideoTrim","createBaseOptions","overrides","saveToPhoto","type","outputExt","openDocumentsOnFinish","openShareSheetOnFinish","removeAfterSavedToPhoto","removeAfterFailedToSavePhoto","removeAfterSavedToDocuments","removeAfterFailedToSaveDocuments","removeAfterShared","removeAfterFailedToShare","enableRotation","rotationAngle","createEditorConfig","enableHapticFeedback","maxDuration","minDuration","cancelButtonText","saveButtonText","enableCancelDialog","cancelDialogTitle","cancelDialogMessage","cancelDialogCancelText","cancelDialogConfirmText","enableSaveDialog","saveDialogTitle","saveDialogMessage","saveDialogCancelText","saveDialogConfirmText","trimmingText","fullScreenModalIOS","autoplay","jumpToPositionOnLoad","closeWhenFinish","enableCancelTrimming","cancelTrimmingButtonText","enableCancelTrimmingDialog","cancelTrimmingDialogTitle","cancelTrimmingDialogMessage","cancelTrimmingDialogCancelText","cancelTrimmingDialogConfirmText","headerText","headerTextSize","headerTextColor","alertOnFailToLoad","alertOnFailTitle","alertOnFailMessage","alertOnFailCloseText","createTrimOptions","startTime","endTime","showEditor","filePath","config","
|
|
1
|
+
{"version":3,"names":["VideoTrimNewArch","VideoTrimOldArch","processColor","isFabric","global","nativeFabricUIManager","VideoTrim","createBaseOptions","overrides","saveToPhoto","type","outputExt","openDocumentsOnFinish","openShareSheetOnFinish","removeAfterSavedToPhoto","removeAfterFailedToSavePhoto","removeAfterSavedToDocuments","removeAfterFailedToSaveDocuments","removeAfterShared","removeAfterFailedToShare","enableRotation","rotationAngle","createEditorConfig","enableHapticFeedback","maxDuration","minDuration","cancelButtonText","saveButtonText","enableCancelDialog","cancelDialogTitle","cancelDialogMessage","cancelDialogCancelText","cancelDialogConfirmText","enableSaveDialog","saveDialogTitle","saveDialogMessage","saveDialogCancelText","saveDialogConfirmText","trimmingText","fullScreenModalIOS","autoplay","jumpToPositionOnLoad","closeWhenFinish","enableCancelTrimming","cancelTrimmingButtonText","enableCancelTrimmingDialog","cancelTrimmingDialogTitle","cancelTrimmingDialogMessage","cancelTrimmingDialogCancelText","cancelTrimmingDialogConfirmText","headerText","headerTextSize","headerTextColor","trimmerColor","handleIconColor","alertOnFailToLoad","alertOnFailTitle","alertOnFailMessage","alertOnFailCloseText","createTrimOptions","startTime","endTime","showEditor","filePath","config","_headerTextColor","_trimmerColor","_handleIconColor","listFiles","cleanFiles","deleteFile","trim","length","Error","closeEditor","isValidFile","url","options"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,OAAOA,gBAAgB,MAAM,sBAAmB;AAChD,OAAOC,gBAAgB,MAAM,cAAW;AAOxC,SAASC,YAAY,QAAQ,cAAc;;AAE3C;AACA,MAAMC,QAAQ,GAAG,CAAC,CAAEC,MAAM,CAASC,qBAAqB;AACxD,MAAMC,SAAS,GAAGH,QAAQ,GAAGH,gBAAgB,GAAGC,gBAAgB;AAEhE,SAASM,iBAAiBA,CAACC,SAA+B,GAAG,CAAC,CAAC,EAAe;EAC5E,OAAO;IACLC,WAAW,EAAE,KAAK;IAClBC,IAAI,EAAE,OAAO;IACbC,SAAS,EAAE,KAAK;IAChBC,qBAAqB,EAAE,KAAK;IAC5BC,sBAAsB,EAAE,KAAK;IAC7BC,uBAAuB,EAAE,KAAK;IAC9BC,4BAA4B,EAAE,KAAK;IACnCC,2BAA2B,EAAE,KAAK;IAClCC,gCAAgC,EAAE,KAAK;IACvCC,iBAAiB,EAAE,KAAK;IACxBC,wBAAwB,EAAE,KAAK;IAC/BC,cAAc,EAAE,KAAK;IACrBC,aAAa,EAAE,CAAC;IAChB,GAAGb;EACL,CAAC;AACH;AAEA,SAASc,kBAAkBA,CACzBd,SAAgC,GAAG,CAAC,CAAC,EACvB;EACd,OAAO;IACLe,oBAAoB,EAAE,IAAI;IAC1BC,WAAW,EAAE,CAAC,CAAC;IACfC,WAAW,EAAE,CAAC,CAAC;IACfC,gBAAgB,EAAE,QAAQ;IAC1BC,cAAc,EAAE,MAAM;IAC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AACC,GAAG,CAAC;AACnC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASL,IAAIA,CAClBK,GAAW,EACXC,OAA6B,EACZ;EACjB,OAAOvE,SAAS,CAACiE,IAAI,CAACK,GAAG,EAAEjB,iBAAiB,CAACkB,OAAO,CAAC,CAAC;AACxD;AAEA,cAAc,sBAAmB;AACjC,eAAevE,SAAS","ignoreList":[]}
|
|
@@ -55,6 +55,14 @@ export interface EditorConfig extends BaseOptions {
|
|
|
55
55
|
* Update status bar to black background color when editor is opened
|
|
56
56
|
*/
|
|
57
57
|
changeStatusBarColorOnOpen?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Color of the trimmer bar
|
|
60
|
+
*/
|
|
61
|
+
trimmerColor?: number;
|
|
62
|
+
/**
|
|
63
|
+
* Color of the trimmer left/right handle icons
|
|
64
|
+
*/
|
|
65
|
+
handleIconColor?: number;
|
|
58
66
|
}
|
|
59
67
|
export interface TrimOptions extends BaseOptions {
|
|
60
68
|
startTime: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeVideoTrim.d.ts","sourceRoot":"","sources":["../../../src/NativeVideoTrim.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AAE9E,MAAM,WAAW,WAAW;IAC1B,WAAW,EAAE,OAAO,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,qBAAqB,EAAE,OAAO,CAAC;IAC/B,sBAAsB,EAAE,OAAO,CAAC;IAChC,uBAAuB,EAAE,OAAO,CAAC;IACjC,4BAA4B,EAAE,OAAO,CAAC;IACtC,2BAA2B,EAAE,OAAO,CAAC;IACrC,gCAAgC,EAAE,OAAO,CAAC;IAC1C,iBAAiB,EAAE,OAAO,CAAC;IAC3B,wBAAwB,EAAE,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AC7B,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC,CAAC;IACH,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;QAC5B,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC,CAAC;CACJ;;AAED,wBAAmE"}
|
|
@@ -8,8 +8,10 @@ declare const VideoTrim: any;
|
|
|
8
8
|
* @param {Function} onEvent: event callback
|
|
9
9
|
* @returns {void}
|
|
10
10
|
*/
|
|
11
|
-
export declare function showEditor(filePath: string, config: Partial<Omit<EditorConfig, 'headerTextColor'>> & {
|
|
11
|
+
export declare function showEditor(filePath: string, config: Partial<Omit<EditorConfig, 'headerTextColor' | 'trimmerColor' | 'handleIconColor'>> & {
|
|
12
12
|
headerTextColor?: string;
|
|
13
|
+
trimmerColor?: string;
|
|
14
|
+
handleIconColor?: string;
|
|
13
15
|
}): void;
|
|
14
16
|
/**
|
|
15
17
|
* List output files generated at all time
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEV,YAAY,EACZ,oBAAoB,EACpB,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAK3B,QAAA,MAAM,SAAS,KAAiD,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEV,YAAY,EACZ,oBAAoB,EACpB,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAK3B,QAAA,MAAM,SAAS,KAAiD,CAAC;AA4EjE;;;;;;;GAOG;AACH,wBAAgB,UAAU,CACxB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,OAAO,CACb,IAAI,CAAC,YAAY,EAAE,iBAAiB,GAAG,cAAc,GAAG,iBAAiB,CAAC,CAC3E,GAAG;IACF,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,GACA,IAAI,CAeN;AAED;;;;GAIG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAE7C;AAED;;;;GAIG;AACH,wBAAgB,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAE5C;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAK7D;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAElC;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAEtE;AAED;;;;;;GAMG;AACH,wBAAgB,IAAI,CAClB,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC,GAC5B,OAAO,CAAC,MAAM,CAAC,CAEjB;AAED,cAAc,mBAAmB,CAAC;AAClC,eAAe,SAAS,CAAC"}
|
package/package.json
CHANGED
package/src/NativeVideoTrim.ts
CHANGED
|
@@ -58,6 +58,14 @@ export interface EditorConfig extends BaseOptions {
|
|
|
58
58
|
* Update status bar to black background color when editor is opened
|
|
59
59
|
*/
|
|
60
60
|
changeStatusBarColorOnOpen?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Color of the trimmer bar
|
|
63
|
+
*/
|
|
64
|
+
trimmerColor?: number;
|
|
65
|
+
/**
|
|
66
|
+
* Color of the trimmer left/right handle icons
|
|
67
|
+
*/
|
|
68
|
+
handleIconColor?: number;
|
|
61
69
|
}
|
|
62
70
|
|
|
63
71
|
export interface TrimOptions extends BaseOptions {
|
package/src/index.tsx
CHANGED
|
@@ -65,6 +65,8 @@ function createEditorConfig(
|
|
|
65
65
|
headerText: '',
|
|
66
66
|
headerTextSize: 16,
|
|
67
67
|
headerTextColor: processColor('white') as number,
|
|
68
|
+
trimmerColor: processColor('#f1d247') as number,
|
|
69
|
+
handleIconColor: processColor('black') as number,
|
|
68
70
|
alertOnFailToLoad: true,
|
|
69
71
|
alertOnFailTitle: 'Error',
|
|
70
72
|
alertOnFailMessage:
|
|
@@ -94,18 +96,26 @@ function createTrimOptions(overrides: Partial<TrimOptions> = {}): TrimOptions {
|
|
|
94
96
|
*/
|
|
95
97
|
export function showEditor(
|
|
96
98
|
filePath: string,
|
|
97
|
-
config: Partial<
|
|
99
|
+
config: Partial<
|
|
100
|
+
Omit<EditorConfig, 'headerTextColor' | 'trimmerColor' | 'handleIconColor'>
|
|
101
|
+
> & {
|
|
98
102
|
headerTextColor?: string;
|
|
103
|
+
trimmerColor?: string;
|
|
104
|
+
handleIconColor?: string;
|
|
99
105
|
}
|
|
100
106
|
): void {
|
|
101
|
-
const { headerTextColor } = config;
|
|
102
|
-
const
|
|
107
|
+
const { headerTextColor, trimmerColor, handleIconColor } = config;
|
|
108
|
+
const _headerTextColor = processColor(headerTextColor || 'white');
|
|
109
|
+
const _trimmerColor = processColor(trimmerColor || '#f1d247');
|
|
110
|
+
const _handleIconColor = processColor(handleIconColor || 'black');
|
|
103
111
|
|
|
104
112
|
VideoTrim.showEditor(
|
|
105
113
|
filePath,
|
|
106
114
|
createEditorConfig({
|
|
107
115
|
...config,
|
|
108
|
-
headerTextColor:
|
|
116
|
+
headerTextColor: _headerTextColor as any,
|
|
117
|
+
trimmerColor: _trimmerColor as any,
|
|
118
|
+
handleIconColor: _handleIconColor as any,
|
|
109
119
|
})
|
|
110
120
|
);
|
|
111
121
|
}
|