react-native-video-trim 2.1.0 → 2.2.1
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 +153 -36
- package/android/src/main/java/com/videotrim/VideoTrimModule.java +109 -21
- package/android/src/main/java/com/videotrim/enums/ErrorCode.java +1 -2
- package/android/src/main/java/com/videotrim/interfaces/VideoTrimListener.java +2 -0
- package/android/src/main/java/com/videotrim/utils/VideoTrimmerUtil.java +12 -9
- package/android/src/main/java/com/videotrim/widgets/VideoTrimmerView.java +118 -58
- package/android/src/main/res/layout/video_trimmer_view.xml +20 -0
- package/ios/AssetLoader.swift +1 -1
- package/ios/ErrorCode.swift +1 -1
- package/ios/ProgressAlertController.swift +100 -0
- package/ios/VideoTrim.swift +130 -48
- package/ios/VideoTrimmerViewController.swift +130 -27
- package/lib/commonjs/index.js +8 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/index.js +9 -2
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/index.d.ts +168 -0
- package/lib/typescript/index.d.ts.map +1 -1
- package/package.json +3 -2
- package/src/index.tsx +176 -3
- package/ios/VideoTrim.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -4
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ColorValue } from 'react-native';
|
|
1
2
|
export interface EditorConfig {
|
|
2
3
|
/**
|
|
3
4
|
* Enable haptic feedback
|
|
@@ -10,20 +11,80 @@ export interface EditorConfig {
|
|
|
10
11
|
*/
|
|
11
12
|
saveToPhoto?: boolean;
|
|
12
13
|
maxDuration?: number;
|
|
14
|
+
/**
|
|
15
|
+
* Minimum duration for trimmer
|
|
16
|
+
* @default 1000
|
|
17
|
+
*/
|
|
13
18
|
minDuration?: number;
|
|
19
|
+
/**
|
|
20
|
+
* Cancel button text
|
|
21
|
+
* @default "Cancel"
|
|
22
|
+
*/
|
|
14
23
|
cancelButtonText?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Save button text
|
|
26
|
+
* @default "Save"
|
|
27
|
+
*/
|
|
15
28
|
saveButtonText?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Enable cancel dialog
|
|
31
|
+
* @default true
|
|
32
|
+
*/
|
|
16
33
|
enableCancelDialog?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Cancel dialog title
|
|
36
|
+
* @default "Warning!"
|
|
37
|
+
*/
|
|
17
38
|
cancelDialogTitle?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Cancel dialog message
|
|
41
|
+
* @default "Are you sure want to cancel?"
|
|
42
|
+
*/
|
|
18
43
|
cancelDialogMessage?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Cancel dialog cancel text
|
|
46
|
+
* @default "Close"
|
|
47
|
+
*/
|
|
19
48
|
cancelDialogCancelText?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Cancel dialog confirm text
|
|
51
|
+
* @default "Proceed"
|
|
52
|
+
*/
|
|
20
53
|
cancelDialogConfirmText?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Enable save dialog
|
|
56
|
+
* @default true
|
|
57
|
+
*/
|
|
21
58
|
enableSaveDialog?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Save dialog title
|
|
61
|
+
* @default "Confirmation!"
|
|
62
|
+
*/
|
|
22
63
|
saveDialogTitle?: string;
|
|
64
|
+
/**
|
|
65
|
+
* Save dialog message
|
|
66
|
+
* @default "Are you sure want to save?"
|
|
67
|
+
*/
|
|
23
68
|
saveDialogMessage?: string;
|
|
69
|
+
/**
|
|
70
|
+
* Save dialog cancel text
|
|
71
|
+
* @default "Close"
|
|
72
|
+
*/
|
|
24
73
|
saveDialogCancelText?: string;
|
|
74
|
+
/**
|
|
75
|
+
* Save dialog confirm text
|
|
76
|
+
* @default "Proceed"
|
|
77
|
+
*/
|
|
25
78
|
saveDialogConfirmText?: string;
|
|
79
|
+
/**
|
|
80
|
+
* Trimming text
|
|
81
|
+
* @default "Trimming video..."
|
|
82
|
+
*/
|
|
26
83
|
trimmingText?: string;
|
|
84
|
+
/**
|
|
85
|
+
* By default, on iOS the editor will be presented as a modal. If you want to present it as a full screen modal, set this to `true`.
|
|
86
|
+
* @default false
|
|
87
|
+
*/
|
|
27
88
|
fullScreenModalIOS?: boolean;
|
|
28
89
|
/**
|
|
29
90
|
* Type of the file to edit. If video file, recommend to use `video`. If audio file, recommend to use `audio`.
|
|
@@ -36,11 +97,35 @@ export interface EditorConfig {
|
|
|
36
97
|
* @example "mp4", "mov", "wav", "m4a", "3gp", "avi", "mkv", "flv", "wmv", "webm"
|
|
37
98
|
*/
|
|
38
99
|
outputExt?: string;
|
|
100
|
+
/**
|
|
101
|
+
* Whether to open Documents app after finish editing
|
|
102
|
+
* @default false
|
|
103
|
+
*/
|
|
39
104
|
openDocumentsOnFinish?: boolean;
|
|
105
|
+
/**
|
|
106
|
+
* Whether to open Share Sheet after finish editing
|
|
107
|
+
* @default false
|
|
108
|
+
*/
|
|
40
109
|
openShareSheetOnFinish?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Remove the file after saved to Photos Library
|
|
112
|
+
* @default false
|
|
113
|
+
*/
|
|
41
114
|
removeAfterSavedToPhoto?: boolean;
|
|
115
|
+
/**
|
|
116
|
+
* Remove the file after failed to save to Photos Library
|
|
117
|
+
* @default false
|
|
118
|
+
*/
|
|
42
119
|
removeAfterFailedToSavePhoto?: boolean;
|
|
120
|
+
/**
|
|
121
|
+
* Remove the file after saved to Documents app
|
|
122
|
+
* @default false
|
|
123
|
+
*/
|
|
43
124
|
removeAfterSavedToDocuments?: boolean;
|
|
125
|
+
/**
|
|
126
|
+
* Remove the file after failed to save to Documents app
|
|
127
|
+
* @default false
|
|
128
|
+
*/
|
|
44
129
|
removeAfterFailedToSaveDocuments?: boolean;
|
|
45
130
|
/**
|
|
46
131
|
* Remove the file after shared to other apps. Currently only support iOS, on Android there's no way to detect if the file is shared or not.
|
|
@@ -52,6 +137,89 @@ export interface EditorConfig {
|
|
|
52
137
|
* @default false
|
|
53
138
|
*/
|
|
54
139
|
removeAfterFailedToShare?: boolean;
|
|
140
|
+
/**
|
|
141
|
+
* Whether to enable autoplay on load
|
|
142
|
+
*/
|
|
143
|
+
autoplay?: boolean;
|
|
144
|
+
/**
|
|
145
|
+
* Jump to position on load in milliseconds
|
|
146
|
+
* @default `undefined` (beginning of the video)
|
|
147
|
+
*/
|
|
148
|
+
jumpToPositionOnLoad?: number;
|
|
149
|
+
/**
|
|
150
|
+
* Whether to close the editor when finish editing
|
|
151
|
+
* @default true
|
|
152
|
+
*/
|
|
153
|
+
closeWhenFinish?: boolean;
|
|
154
|
+
/**
|
|
155
|
+
* Enable cancel trimming
|
|
156
|
+
* @default true
|
|
157
|
+
*/
|
|
158
|
+
enableCancelTrimming?: boolean;
|
|
159
|
+
/**
|
|
160
|
+
* Cancel trimming button text
|
|
161
|
+
* @default "Cancel"
|
|
162
|
+
*/
|
|
163
|
+
cancelTrimmingButtonText?: string;
|
|
164
|
+
/**
|
|
165
|
+
* Enable cancel trimming dialog
|
|
166
|
+
* @default true
|
|
167
|
+
*/
|
|
168
|
+
enableCancelTrimmingDialog?: boolean;
|
|
169
|
+
/**
|
|
170
|
+
* Cancel trimming dialog title
|
|
171
|
+
* @default "Warning!"
|
|
172
|
+
*/
|
|
173
|
+
cancelTrimmingDialogTitle?: string;
|
|
174
|
+
/**
|
|
175
|
+
* Cancel trimming dialog message
|
|
176
|
+
* @default "Are you sure want to cancel trimming?"
|
|
177
|
+
*/
|
|
178
|
+
cancelTrimmingDialogMessage?: string;
|
|
179
|
+
/**
|
|
180
|
+
* Cancel trimming dialog cancel text
|
|
181
|
+
* @default "Close"
|
|
182
|
+
*/
|
|
183
|
+
cancelTrimmingDialogCancelText?: string;
|
|
184
|
+
/**
|
|
185
|
+
* Cancel trimming dialog confirm text
|
|
186
|
+
* @default "Proceed"
|
|
187
|
+
*/
|
|
188
|
+
cancelTrimmingDialogConfirmText?: string;
|
|
189
|
+
/**
|
|
190
|
+
* Header text
|
|
191
|
+
*/
|
|
192
|
+
headerText?: string;
|
|
193
|
+
/**
|
|
194
|
+
* Header text size
|
|
195
|
+
* @default 16
|
|
196
|
+
*/
|
|
197
|
+
headerTextSize?: number;
|
|
198
|
+
/**
|
|
199
|
+
* Header text color
|
|
200
|
+
* @default white
|
|
201
|
+
*/
|
|
202
|
+
headerTextColor?: ColorValue;
|
|
203
|
+
/**
|
|
204
|
+
* Alert on fail to load media
|
|
205
|
+
* @default true
|
|
206
|
+
*/
|
|
207
|
+
alertOnFailToLoad?: boolean;
|
|
208
|
+
/**
|
|
209
|
+
* Alert on fail to load media title
|
|
210
|
+
* @default "Error"
|
|
211
|
+
*/
|
|
212
|
+
alertOnFailTitle?: string;
|
|
213
|
+
/**
|
|
214
|
+
* Alert on fail to load media message
|
|
215
|
+
* @default "Fail to load media. Possibly invalid file or no network connection"
|
|
216
|
+
*/
|
|
217
|
+
alertOnFailMessage?: string;
|
|
218
|
+
/**
|
|
219
|
+
* Alert on fail to load media close text
|
|
220
|
+
* @default "Close"
|
|
221
|
+
*/
|
|
222
|
+
alertOnFailCloseText?: string;
|
|
55
223
|
}
|
|
56
224
|
/**
|
|
57
225
|
* Delete a file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,UAAU,EAChB,MAAM,cAAc,CAAC;AAmBtB,MAAM,WAAW,YAAY;IAC3B;;;OAGG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC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WAAW,IAAI,IAAI,CAElC;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAEzD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-video-trim",
|
|
3
|
-
"version": "2.1
|
|
3
|
+
"version": "2.2.1",
|
|
4
4
|
"description": "Video trimmer for your React Native app",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -158,5 +158,6 @@
|
|
|
158
158
|
}
|
|
159
159
|
]
|
|
160
160
|
]
|
|
161
|
-
}
|
|
161
|
+
},
|
|
162
|
+
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
|
|
162
163
|
}
|
package/src/index.tsx
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
NativeModules,
|
|
3
|
+
Platform,
|
|
4
|
+
processColor,
|
|
5
|
+
type ColorValue,
|
|
6
|
+
} from 'react-native';
|
|
2
7
|
|
|
3
8
|
const LINKING_ERROR =
|
|
4
9
|
`The package 'react-native-video-trim' doesn't seem to be linked. Make sure: \n\n` +
|
|
@@ -29,20 +34,80 @@ export interface EditorConfig {
|
|
|
29
34
|
*/
|
|
30
35
|
saveToPhoto?: boolean;
|
|
31
36
|
maxDuration?: number;
|
|
37
|
+
/**
|
|
38
|
+
* Minimum duration for trimmer
|
|
39
|
+
* @default 1000
|
|
40
|
+
*/
|
|
32
41
|
minDuration?: number;
|
|
42
|
+
/**
|
|
43
|
+
* Cancel button text
|
|
44
|
+
* @default "Cancel"
|
|
45
|
+
*/
|
|
33
46
|
cancelButtonText?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Save button text
|
|
49
|
+
* @default "Save"
|
|
50
|
+
*/
|
|
34
51
|
saveButtonText?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Enable cancel dialog
|
|
54
|
+
* @default true
|
|
55
|
+
*/
|
|
35
56
|
enableCancelDialog?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Cancel dialog title
|
|
59
|
+
* @default "Warning!"
|
|
60
|
+
*/
|
|
36
61
|
cancelDialogTitle?: string;
|
|
62
|
+
/**
|
|
63
|
+
* Cancel dialog message
|
|
64
|
+
* @default "Are you sure want to cancel?"
|
|
65
|
+
*/
|
|
37
66
|
cancelDialogMessage?: string;
|
|
67
|
+
/**
|
|
68
|
+
* Cancel dialog cancel text
|
|
69
|
+
* @default "Close"
|
|
70
|
+
*/
|
|
38
71
|
cancelDialogCancelText?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Cancel dialog confirm text
|
|
74
|
+
* @default "Proceed"
|
|
75
|
+
*/
|
|
39
76
|
cancelDialogConfirmText?: string;
|
|
77
|
+
/**
|
|
78
|
+
* Enable save dialog
|
|
79
|
+
* @default true
|
|
80
|
+
*/
|
|
40
81
|
enableSaveDialog?: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Save dialog title
|
|
84
|
+
* @default "Confirmation!"
|
|
85
|
+
*/
|
|
41
86
|
saveDialogTitle?: string;
|
|
87
|
+
/**
|
|
88
|
+
* Save dialog message
|
|
89
|
+
* @default "Are you sure want to save?"
|
|
90
|
+
*/
|
|
42
91
|
saveDialogMessage?: string;
|
|
92
|
+
/**
|
|
93
|
+
* Save dialog cancel text
|
|
94
|
+
* @default "Close"
|
|
95
|
+
*/
|
|
43
96
|
saveDialogCancelText?: string;
|
|
97
|
+
/**
|
|
98
|
+
* Save dialog confirm text
|
|
99
|
+
* @default "Proceed"
|
|
100
|
+
*/
|
|
44
101
|
saveDialogConfirmText?: string;
|
|
102
|
+
/**
|
|
103
|
+
* Trimming text
|
|
104
|
+
* @default "Trimming video..."
|
|
105
|
+
*/
|
|
45
106
|
trimmingText?: string;
|
|
107
|
+
/**
|
|
108
|
+
* By default, on iOS the editor will be presented as a modal. If you want to present it as a full screen modal, set this to `true`.
|
|
109
|
+
* @default false
|
|
110
|
+
*/
|
|
46
111
|
fullScreenModalIOS?: boolean;
|
|
47
112
|
/**
|
|
48
113
|
* Type of the file to edit. If video file, recommend to use `video`. If audio file, recommend to use `audio`.
|
|
@@ -55,12 +120,35 @@ export interface EditorConfig {
|
|
|
55
120
|
* @example "mp4", "mov", "wav", "m4a", "3gp", "avi", "mkv", "flv", "wmv", "webm"
|
|
56
121
|
*/
|
|
57
122
|
outputExt?: string;
|
|
123
|
+
/**
|
|
124
|
+
* Whether to open Documents app after finish editing
|
|
125
|
+
* @default false
|
|
126
|
+
*/
|
|
58
127
|
openDocumentsOnFinish?: boolean;
|
|
128
|
+
/**
|
|
129
|
+
* Whether to open Share Sheet after finish editing
|
|
130
|
+
* @default false
|
|
131
|
+
*/
|
|
59
132
|
openShareSheetOnFinish?: boolean;
|
|
60
|
-
|
|
133
|
+
/**
|
|
134
|
+
* Remove the file after saved to Photos Library
|
|
135
|
+
* @default false
|
|
136
|
+
*/
|
|
61
137
|
removeAfterSavedToPhoto?: boolean;
|
|
138
|
+
/**
|
|
139
|
+
* Remove the file after failed to save to Photos Library
|
|
140
|
+
* @default false
|
|
141
|
+
*/
|
|
62
142
|
removeAfterFailedToSavePhoto?: boolean;
|
|
143
|
+
/**
|
|
144
|
+
* Remove the file after saved to Documents app
|
|
145
|
+
* @default false
|
|
146
|
+
*/
|
|
63
147
|
removeAfterSavedToDocuments?: boolean;
|
|
148
|
+
/**
|
|
149
|
+
* Remove the file after failed to save to Documents app
|
|
150
|
+
* @default false
|
|
151
|
+
*/
|
|
64
152
|
removeAfterFailedToSaveDocuments?: boolean;
|
|
65
153
|
/**
|
|
66
154
|
* Remove the file after shared to other apps. Currently only support iOS, on Android there's no way to detect if the file is shared or not.
|
|
@@ -72,6 +160,89 @@ export interface EditorConfig {
|
|
|
72
160
|
* @default false
|
|
73
161
|
*/
|
|
74
162
|
removeAfterFailedToShare?: boolean;
|
|
163
|
+
/**
|
|
164
|
+
* Whether to enable autoplay on load
|
|
165
|
+
*/
|
|
166
|
+
autoplay?: boolean;
|
|
167
|
+
/**
|
|
168
|
+
* Jump to position on load in milliseconds
|
|
169
|
+
* @default `undefined` (beginning of the video)
|
|
170
|
+
*/
|
|
171
|
+
jumpToPositionOnLoad?: number;
|
|
172
|
+
/**
|
|
173
|
+
* Whether to close the editor when finish editing
|
|
174
|
+
* @default true
|
|
175
|
+
*/
|
|
176
|
+
closeWhenFinish?: boolean;
|
|
177
|
+
/**
|
|
178
|
+
* Enable cancel trimming
|
|
179
|
+
* @default true
|
|
180
|
+
*/
|
|
181
|
+
enableCancelTrimming?: boolean;
|
|
182
|
+
/**
|
|
183
|
+
* Cancel trimming button text
|
|
184
|
+
* @default "Cancel"
|
|
185
|
+
*/
|
|
186
|
+
cancelTrimmingButtonText?: string;
|
|
187
|
+
/**
|
|
188
|
+
* Enable cancel trimming dialog
|
|
189
|
+
* @default true
|
|
190
|
+
*/
|
|
191
|
+
enableCancelTrimmingDialog?: boolean;
|
|
192
|
+
/**
|
|
193
|
+
* Cancel trimming dialog title
|
|
194
|
+
* @default "Warning!"
|
|
195
|
+
*/
|
|
196
|
+
cancelTrimmingDialogTitle?: string;
|
|
197
|
+
/**
|
|
198
|
+
* Cancel trimming dialog message
|
|
199
|
+
* @default "Are you sure want to cancel trimming?"
|
|
200
|
+
*/
|
|
201
|
+
cancelTrimmingDialogMessage?: string;
|
|
202
|
+
/**
|
|
203
|
+
* Cancel trimming dialog cancel text
|
|
204
|
+
* @default "Close"
|
|
205
|
+
*/
|
|
206
|
+
cancelTrimmingDialogCancelText?: string;
|
|
207
|
+
/**
|
|
208
|
+
* Cancel trimming dialog confirm text
|
|
209
|
+
* @default "Proceed"
|
|
210
|
+
*/
|
|
211
|
+
cancelTrimmingDialogConfirmText?: string;
|
|
212
|
+
/**
|
|
213
|
+
* Header text
|
|
214
|
+
*/
|
|
215
|
+
headerText?: string;
|
|
216
|
+
/**
|
|
217
|
+
* Header text size
|
|
218
|
+
* @default 16
|
|
219
|
+
*/
|
|
220
|
+
headerTextSize?: number;
|
|
221
|
+
/**
|
|
222
|
+
* Header text color
|
|
223
|
+
* @default white
|
|
224
|
+
*/
|
|
225
|
+
headerTextColor?: ColorValue;
|
|
226
|
+
/**
|
|
227
|
+
* Alert on fail to load media
|
|
228
|
+
* @default true
|
|
229
|
+
*/
|
|
230
|
+
alertOnFailToLoad?: boolean;
|
|
231
|
+
/**
|
|
232
|
+
* Alert on fail to load media title
|
|
233
|
+
* @default "Error"
|
|
234
|
+
*/
|
|
235
|
+
alertOnFailTitle?: string;
|
|
236
|
+
/**
|
|
237
|
+
* Alert on fail to load media message
|
|
238
|
+
* @default "Fail to load media. Possibly invalid file or no network connection"
|
|
239
|
+
*/
|
|
240
|
+
alertOnFailMessage?: string;
|
|
241
|
+
/**
|
|
242
|
+
* Alert on fail to load media close text
|
|
243
|
+
* @default "Close"
|
|
244
|
+
*/
|
|
245
|
+
alertOnFailCloseText?: string;
|
|
75
246
|
}
|
|
76
247
|
|
|
77
248
|
/**
|
|
@@ -82,7 +253,9 @@ export interface EditorConfig {
|
|
|
82
253
|
* @returns {void} A **Promise** which resolves `void`
|
|
83
254
|
*/
|
|
84
255
|
export function showEditor(filePath: string, config: EditorConfig = {}): void {
|
|
85
|
-
|
|
256
|
+
const { headerTextColor } = config;
|
|
257
|
+
const color = processColor(headerTextColor);
|
|
258
|
+
VideoTrim.showEditor(filePath, { ...config, headerTextColor: color });
|
|
86
259
|
}
|
|
87
260
|
|
|
88
261
|
/**
|