@capgo/capacitor-video-player 7.0.0
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/CapgoCapacitorVideoPlayer.podspec +17 -0
- package/Package.swift +28 -0
- package/README.md +431 -0
- package/android/build.gradle +72 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/java/com/capgo/videoplayer/FullscreenExoPlayerFragment.java +1406 -0
- package/android/src/main/java/com/capgo/videoplayer/Notifications/MyRunnable.java +21 -0
- package/android/src/main/java/com/capgo/videoplayer/Notifications/NotificationCenter.java +61 -0
- package/android/src/main/java/com/capgo/videoplayer/PickerVideo/AdapterVideoList.java +47 -0
- package/android/src/main/java/com/capgo/videoplayer/PickerVideo/ModelVideo.java +49 -0
- package/android/src/main/java/com/capgo/videoplayer/PickerVideo/PickerVideoFragment.java +116 -0
- package/android/src/main/java/com/capgo/videoplayer/PickerVideo/VideoRecyclerViewHolder.java +65 -0
- package/android/src/main/java/com/capgo/videoplayer/Utilities/FilesUtils.java +38 -0
- package/android/src/main/java/com/capgo/videoplayer/Utilities/FragmentUtils.java +32 -0
- package/android/src/main/java/com/capgo/videoplayer/VideoPlayer.java +71 -0
- package/android/src/main/java/com/capgo/videoplayer/VideoPlayerPlugin.java +1239 -0
- package/android/src/main/res/.gitkeep +0 -0
- package/android/src/main/res/drawable/bg_round_rect_white_50.xml +9 -0
- package/android/src/main/res/drawable/bg_rounded_rectangle_white_corner_rounded.xml +10 -0
- package/android/src/main/res/drawable/exo_close_btn.xml +12 -0
- package/android/src/main/res/drawable/gradient_transparent_middle.xml +12 -0
- package/android/src/main/res/drawable/ic_arrow_left.xml +5 -0
- package/android/src/main/res/drawable/ic_baseline_lq.xml +7 -0
- package/android/src/main/res/drawable/ic_exo_icon_fastforward.xml +35 -0
- package/android/src/main/res/drawable/ic_exo_icon_pause.xml +26 -0
- package/android/src/main/res/drawable/ic_exo_icon_play.xml +36 -0
- package/android/src/main/res/drawable/ic_exo_icon_rewind.xml +35 -0
- package/android/src/main/res/drawable/ic_expand.xml +5 -0
- package/android/src/main/res/drawable/ic_fit.xml +5 -0
- package/android/src/main/res/drawable/ic_image_background.xml +12 -0
- package/android/src/main/res/drawable/ic_img_16_9_background.xml +10 -0
- package/android/src/main/res/drawable/ic_img_9_16_background.xml +10 -0
- package/android/src/main/res/drawable/ic_outline_lock.xml +5 -0
- package/android/src/main/res/drawable/ic_outline_lock_open.xml +5 -0
- package/android/src/main/res/drawable/ic_pip_white.xml +5 -0
- package/android/src/main/res/drawable/ic_views.xml +18 -0
- package/android/src/main/res/drawable/ic_zoom.xml +5 -0
- package/android/src/main/res/layout/bridge_layout_main.xml +15 -0
- package/android/src/main/res/layout/exo_playback_control_view.xml +287 -0
- package/android/src/main/res/layout/exoplayer_layout_youtube.xml +361 -0
- package/android/src/main/res/layout/fragment_fs_exoplayer.xml +50 -0
- package/android/src/main/res/layout/fragment_picker_video.xml +21 -0
- package/android/src/main/res/layout/row_video.xml +76 -0
- package/android/src/main/res/values/colors.xml +14 -0
- package/android/src/main/res/values/strings.xml +3 -0
- package/android/src/main/res/values/styles.xml +3 -0
- package/dist/docs.json +686 -0
- package/dist/esm/definitions.d.ts +307 -0
- package/dist/esm/definitions.js +2 -0
- package/dist/esm/definitions.js.map +1 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.js +7 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/web-utils/video-types.d.ts +4 -0
- package/dist/esm/web-utils/video-types.js +9 -0
- package/dist/esm/web-utils/video-types.js.map +1 -0
- package/dist/esm/web-utils/videoplayer.d.ts +30 -0
- package/dist/esm/web-utils/videoplayer.js +323 -0
- package/dist/esm/web-utils/videoplayer.js.map +1 -0
- package/dist/esm/web.d.ts +121 -0
- package/dist/esm/web.js +675 -0
- package/dist/esm/web.js.map +1 -0
- package/dist/plugin.cjs.js +1019 -0
- package/dist/plugin.cjs.js.map +1 -0
- package/dist/plugin.js +1021 -0
- package/dist/plugin.js.map +1 -0
- package/ios/Sources/VideoPlayerPlugin/VideoPlayer.swift +8 -0
- package/ios/Sources/VideoPlayerPlugin/VideoPlayerPlugin.swift +23 -0
- package/ios/Tests/VideoPlayerPluginTests/VideoPlayerPluginTests.swift +15 -0
- package/package.json +85 -0
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
export interface VideoPlayerPlugin {
|
|
2
|
+
/**
|
|
3
|
+
* Echo
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
echo(options: capEchoOptions): Promise<capVideoPlayerResult>;
|
|
7
|
+
/**
|
|
8
|
+
* Initialize a video player
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
initPlayer(options: capVideoPlayerOptions): Promise<capVideoPlayerResult>;
|
|
12
|
+
/**
|
|
13
|
+
* Return if a given playerId is playing
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
16
|
+
isPlaying(options: capVideoPlayerIdOptions): Promise<capVideoPlayerResult>;
|
|
17
|
+
/**
|
|
18
|
+
* Play the current video from a given playerId
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
play(options: capVideoPlayerIdOptions): Promise<capVideoPlayerResult>;
|
|
22
|
+
/**
|
|
23
|
+
* Pause the current video from a given playerId
|
|
24
|
+
*
|
|
25
|
+
*/
|
|
26
|
+
pause(options: capVideoPlayerIdOptions): Promise<capVideoPlayerResult>;
|
|
27
|
+
/**
|
|
28
|
+
* Get the duration of the current video from a given playerId
|
|
29
|
+
*
|
|
30
|
+
*/
|
|
31
|
+
getDuration(options: capVideoPlayerIdOptions): Promise<capVideoPlayerResult>;
|
|
32
|
+
/**
|
|
33
|
+
* Get the current time of the current video from a given playerId
|
|
34
|
+
*
|
|
35
|
+
*/
|
|
36
|
+
getCurrentTime(options: capVideoPlayerIdOptions): Promise<capVideoPlayerResult>;
|
|
37
|
+
/**
|
|
38
|
+
* Set the current time to seek the current video to from a given playerId
|
|
39
|
+
*
|
|
40
|
+
*/
|
|
41
|
+
setCurrentTime(options: capVideoTimeOptions): Promise<capVideoPlayerResult>;
|
|
42
|
+
/**
|
|
43
|
+
* Get the volume of the current video from a given playerId
|
|
44
|
+
*
|
|
45
|
+
*/
|
|
46
|
+
getVolume(options: capVideoPlayerIdOptions): Promise<capVideoPlayerResult>;
|
|
47
|
+
/**
|
|
48
|
+
* Set the volume of the current video to from a given playerId
|
|
49
|
+
*
|
|
50
|
+
*/
|
|
51
|
+
setVolume(options: capVideoVolumeOptions): Promise<capVideoPlayerResult>;
|
|
52
|
+
/**
|
|
53
|
+
* Get the muted of the current video from a given playerId
|
|
54
|
+
*
|
|
55
|
+
*/
|
|
56
|
+
getMuted(options: capVideoPlayerIdOptions): Promise<capVideoPlayerResult>;
|
|
57
|
+
/**
|
|
58
|
+
* Set the muted of the current video to from a given playerId
|
|
59
|
+
*
|
|
60
|
+
*/
|
|
61
|
+
setMuted(options: capVideoMutedOptions): Promise<capVideoPlayerResult>;
|
|
62
|
+
/**
|
|
63
|
+
* Set the rate of the current video from a given playerId
|
|
64
|
+
*
|
|
65
|
+
*/
|
|
66
|
+
setRate(options: capVideoRateOptions): Promise<capVideoPlayerResult>;
|
|
67
|
+
/**
|
|
68
|
+
* Get the rate of the current video from a given playerId
|
|
69
|
+
*
|
|
70
|
+
*/
|
|
71
|
+
getRate(options: capVideoPlayerIdOptions): Promise<capVideoPlayerResult>;
|
|
72
|
+
/**
|
|
73
|
+
* Stop all players playing
|
|
74
|
+
*
|
|
75
|
+
*/
|
|
76
|
+
stopAllPlayers(): Promise<capVideoPlayerResult>;
|
|
77
|
+
/**
|
|
78
|
+
* Show controller
|
|
79
|
+
*
|
|
80
|
+
*/
|
|
81
|
+
showController(): Promise<capVideoPlayerResult>;
|
|
82
|
+
/**
|
|
83
|
+
* isControllerIsFullyVisible
|
|
84
|
+
*
|
|
85
|
+
*/
|
|
86
|
+
isControllerIsFullyVisible(): Promise<capVideoPlayerResult>;
|
|
87
|
+
/**
|
|
88
|
+
* Exit player
|
|
89
|
+
*
|
|
90
|
+
*/
|
|
91
|
+
exitPlayer(): Promise<capVideoPlayerResult>;
|
|
92
|
+
}
|
|
93
|
+
export interface capEchoOptions {
|
|
94
|
+
/**
|
|
95
|
+
* String to be echoed
|
|
96
|
+
*/
|
|
97
|
+
value?: string;
|
|
98
|
+
}
|
|
99
|
+
export interface capVideoPlayerOptions {
|
|
100
|
+
/**
|
|
101
|
+
* Player mode
|
|
102
|
+
* - "fullscreen"
|
|
103
|
+
* - "embedded" (Web only)
|
|
104
|
+
*/
|
|
105
|
+
mode?: string;
|
|
106
|
+
/**
|
|
107
|
+
* The url of the video to play
|
|
108
|
+
*/
|
|
109
|
+
url?: string;
|
|
110
|
+
/**
|
|
111
|
+
* The url of subtitle associated with the video
|
|
112
|
+
*/
|
|
113
|
+
subtitle?: string;
|
|
114
|
+
/**
|
|
115
|
+
* The language of subtitle
|
|
116
|
+
* see https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers
|
|
117
|
+
*/
|
|
118
|
+
language?: string;
|
|
119
|
+
/**
|
|
120
|
+
* SubTitle Options
|
|
121
|
+
*/
|
|
122
|
+
subtitleOptions?: SubTitleOptions;
|
|
123
|
+
/**
|
|
124
|
+
* Id of DIV Element parent of the player
|
|
125
|
+
*/
|
|
126
|
+
playerId?: string;
|
|
127
|
+
/**
|
|
128
|
+
* Initial playing rate
|
|
129
|
+
*/
|
|
130
|
+
rate?: number;
|
|
131
|
+
/**
|
|
132
|
+
* Exit on VideoEnd (iOS, Android)
|
|
133
|
+
* default: true
|
|
134
|
+
*/
|
|
135
|
+
exitOnEnd?: boolean;
|
|
136
|
+
/**
|
|
137
|
+
* Loop on VideoEnd when exitOnEnd false (iOS, Android)
|
|
138
|
+
* default: false
|
|
139
|
+
*/
|
|
140
|
+
loopOnEnd?: boolean;
|
|
141
|
+
/**
|
|
142
|
+
* Picture in Picture Enable (iOS, Android)
|
|
143
|
+
* default: true
|
|
144
|
+
*/
|
|
145
|
+
pipEnabled?: boolean;
|
|
146
|
+
/**
|
|
147
|
+
* Background Mode Enable (iOS, Android)
|
|
148
|
+
* default: true
|
|
149
|
+
*/
|
|
150
|
+
bkmodeEnabled?: boolean;
|
|
151
|
+
/**
|
|
152
|
+
* Show Controls Enable (iOS, Android)
|
|
153
|
+
* default: true
|
|
154
|
+
*/
|
|
155
|
+
showControls?: boolean;
|
|
156
|
+
/**
|
|
157
|
+
* Display Mode ["all", "portrait", "landscape"] (iOS, Android)
|
|
158
|
+
* default: "all"
|
|
159
|
+
*/
|
|
160
|
+
displayMode?: string;
|
|
161
|
+
/**
|
|
162
|
+
* Component Tag or DOM Element Tag (React app)
|
|
163
|
+
*/
|
|
164
|
+
componentTag?: string;
|
|
165
|
+
/**
|
|
166
|
+
* Player Width (mode "embedded" only)
|
|
167
|
+
*/
|
|
168
|
+
width?: number;
|
|
169
|
+
/**
|
|
170
|
+
* Player height (mode "embedded" only)
|
|
171
|
+
*/
|
|
172
|
+
height?: number;
|
|
173
|
+
/**
|
|
174
|
+
* Headers for the request (iOS, Android)
|
|
175
|
+
* by Manuel García Marín (https://github.com/PhantomPainX)
|
|
176
|
+
*/
|
|
177
|
+
headers?: {
|
|
178
|
+
[key: string]: string;
|
|
179
|
+
};
|
|
180
|
+
/**
|
|
181
|
+
* Title shown in the player (Android)
|
|
182
|
+
* by Manuel García Marín (https://github.com/PhantomPainX)
|
|
183
|
+
*/
|
|
184
|
+
title?: string;
|
|
185
|
+
/**
|
|
186
|
+
* Subtitle shown below the title in the player (Android)
|
|
187
|
+
* by Manuel García Marín (https://github.com/PhantomPainX)
|
|
188
|
+
*/
|
|
189
|
+
smallTitle?: string;
|
|
190
|
+
/**
|
|
191
|
+
* ExoPlayer Progress Bar and Spinner color (Android)
|
|
192
|
+
* by Manuel García Marín (https://github.com/PhantomPainX)
|
|
193
|
+
* Must be a valid hex color code
|
|
194
|
+
* default: #FFFFFF
|
|
195
|
+
*/
|
|
196
|
+
accentColor?: string;
|
|
197
|
+
/**
|
|
198
|
+
* Chromecast enable/disable (Android)
|
|
199
|
+
* by Manuel García Marín (https://github.com/PhantomPainX)
|
|
200
|
+
* default: true
|
|
201
|
+
*/
|
|
202
|
+
chromecast?: boolean;
|
|
203
|
+
/**
|
|
204
|
+
* Artwork url to be shown in Chromecast player
|
|
205
|
+
* by Manuel García Marín (https://github.com/PhantomPainX)
|
|
206
|
+
* default: ""
|
|
207
|
+
*/
|
|
208
|
+
artwork?: string;
|
|
209
|
+
}
|
|
210
|
+
export interface capVideoPlayerIdOptions {
|
|
211
|
+
/**
|
|
212
|
+
* Id of DIV Element parent of the player
|
|
213
|
+
*/
|
|
214
|
+
playerId?: string;
|
|
215
|
+
}
|
|
216
|
+
export interface capVideoRateOptions {
|
|
217
|
+
/**
|
|
218
|
+
* Id of DIV Element parent of the player
|
|
219
|
+
*/
|
|
220
|
+
playerId?: string;
|
|
221
|
+
/**
|
|
222
|
+
* Rate value
|
|
223
|
+
*/
|
|
224
|
+
rate?: number;
|
|
225
|
+
}
|
|
226
|
+
export interface capVideoVolumeOptions {
|
|
227
|
+
/**
|
|
228
|
+
* Id of DIV Element parent of the player
|
|
229
|
+
*/
|
|
230
|
+
playerId?: string;
|
|
231
|
+
/**
|
|
232
|
+
* Volume value between [0 - 1]
|
|
233
|
+
*/
|
|
234
|
+
volume?: number;
|
|
235
|
+
}
|
|
236
|
+
export interface capVideoTimeOptions {
|
|
237
|
+
/**
|
|
238
|
+
* Id of DIV Element parent of the player
|
|
239
|
+
*/
|
|
240
|
+
playerId?: string;
|
|
241
|
+
/**
|
|
242
|
+
* Video time value you want to seek to
|
|
243
|
+
*/
|
|
244
|
+
seektime?: number;
|
|
245
|
+
}
|
|
246
|
+
export interface capVideoMutedOptions {
|
|
247
|
+
/**
|
|
248
|
+
* Id of DIV Element parent of the player
|
|
249
|
+
*/
|
|
250
|
+
playerId?: string;
|
|
251
|
+
/**
|
|
252
|
+
* Muted value true or false
|
|
253
|
+
*/
|
|
254
|
+
muted?: boolean;
|
|
255
|
+
}
|
|
256
|
+
export interface capVideoListener {
|
|
257
|
+
/**
|
|
258
|
+
* Id of DIV Element parent of the player
|
|
259
|
+
*/
|
|
260
|
+
playerId?: string;
|
|
261
|
+
/**
|
|
262
|
+
* Video current time when listener trigerred
|
|
263
|
+
*/
|
|
264
|
+
currentTime?: number;
|
|
265
|
+
}
|
|
266
|
+
export interface capExitListener {
|
|
267
|
+
/**
|
|
268
|
+
* Dismiss value true or false
|
|
269
|
+
*/
|
|
270
|
+
dismiss?: boolean;
|
|
271
|
+
/**
|
|
272
|
+
* Video current time when listener trigerred
|
|
273
|
+
*/
|
|
274
|
+
currentTime?: number;
|
|
275
|
+
}
|
|
276
|
+
export interface capVideoPlayerResult {
|
|
277
|
+
/**
|
|
278
|
+
* result set to true when successful else false
|
|
279
|
+
*/
|
|
280
|
+
result?: boolean;
|
|
281
|
+
/**
|
|
282
|
+
* method name
|
|
283
|
+
*/
|
|
284
|
+
method?: string;
|
|
285
|
+
/**
|
|
286
|
+
* value returned
|
|
287
|
+
*/
|
|
288
|
+
value?: any;
|
|
289
|
+
/**
|
|
290
|
+
* message string
|
|
291
|
+
*/
|
|
292
|
+
message?: string;
|
|
293
|
+
}
|
|
294
|
+
export interface SubTitleOptions {
|
|
295
|
+
/**
|
|
296
|
+
* Foreground Color in RGBA (default rgba(255,255,255,1)
|
|
297
|
+
*/
|
|
298
|
+
foregroundColor?: string;
|
|
299
|
+
/**
|
|
300
|
+
* Background Color in RGBA (default rgba(0,0,0,1)
|
|
301
|
+
*/
|
|
302
|
+
backgroundColor?: string;
|
|
303
|
+
/**
|
|
304
|
+
* Font Size in pixels (default 16)
|
|
305
|
+
*/
|
|
306
|
+
fontSize?: number;
|
|
307
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["export interface VideoPlayerPlugin {\n /**\n * Echo\n *\n */\n echo(options: capEchoOptions): Promise<capVideoPlayerResult>;\n /**\n * Initialize a video player\n *\n */\n initPlayer(options: capVideoPlayerOptions): Promise<capVideoPlayerResult>;\n /**\n * Return if a given playerId is playing\n *\n */\n isPlaying(options: capVideoPlayerIdOptions): Promise<capVideoPlayerResult>;\n /**\n * Play the current video from a given playerId\n *\n */\n play(options: capVideoPlayerIdOptions): Promise<capVideoPlayerResult>;\n /**\n * Pause the current video from a given playerId\n *\n */\n pause(options: capVideoPlayerIdOptions): Promise<capVideoPlayerResult>;\n /**\n * Get the duration of the current video from a given playerId\n *\n */\n getDuration(options: capVideoPlayerIdOptions): Promise<capVideoPlayerResult>;\n /**\n * Get the current time of the current video from a given playerId\n *\n */\n getCurrentTime(options: capVideoPlayerIdOptions): Promise<capVideoPlayerResult>;\n /**\n * Set the current time to seek the current video to from a given playerId\n *\n */\n setCurrentTime(options: capVideoTimeOptions): Promise<capVideoPlayerResult>;\n /**\n * Get the volume of the current video from a given playerId\n *\n */\n getVolume(options: capVideoPlayerIdOptions): Promise<capVideoPlayerResult>;\n /**\n * Set the volume of the current video to from a given playerId\n *\n */\n setVolume(options: capVideoVolumeOptions): Promise<capVideoPlayerResult>;\n /**\n * Get the muted of the current video from a given playerId\n *\n */\n getMuted(options: capVideoPlayerIdOptions): Promise<capVideoPlayerResult>;\n /**\n * Set the muted of the current video to from a given playerId\n *\n */\n setMuted(options: capVideoMutedOptions): Promise<capVideoPlayerResult>;\n /**\n * Set the rate of the current video from a given playerId\n *\n */\n setRate(options: capVideoRateOptions): Promise<capVideoPlayerResult>;\n /**\n * Get the rate of the current video from a given playerId\n *\n */\n getRate(options: capVideoPlayerIdOptions): Promise<capVideoPlayerResult>;\n /**\n * Stop all players playing\n *\n */\n stopAllPlayers(): Promise<capVideoPlayerResult>;\n /**\n * Show controller\n *\n */\n showController(): Promise<capVideoPlayerResult>;\n /**\n * isControllerIsFullyVisible\n *\n */\n isControllerIsFullyVisible(): Promise<capVideoPlayerResult>;\n /**\n * Exit player\n *\n */\n exitPlayer(): Promise<capVideoPlayerResult>;\n}\nexport interface capEchoOptions {\n /**\n * String to be echoed\n */\n\n value?: string;\n}\nexport interface capVideoPlayerOptions {\n /**\n * Player mode\n * - \"fullscreen\"\n * - \"embedded\" (Web only)\n */\n mode?: string;\n /**\n * The url of the video to play\n */\n url?: string;\n /**\n * The url of subtitle associated with the video\n */\n subtitle?: string;\n /**\n * The language of subtitle\n * see https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers\n */\n language?: string;\n /**\n * SubTitle Options\n */\n subtitleOptions?: SubTitleOptions;\n /**\n * Id of DIV Element parent of the player\n */\n playerId?: string;\n /**\n * Initial playing rate\n */\n rate?: number;\n /**\n * Exit on VideoEnd (iOS, Android)\n * default: true\n */\n exitOnEnd?: boolean;\n /**\n * Loop on VideoEnd when exitOnEnd false (iOS, Android)\n * default: false\n */\n loopOnEnd?: boolean;\n /**\n * Picture in Picture Enable (iOS, Android)\n * default: true\n */\n pipEnabled?: boolean;\n /**\n * Background Mode Enable (iOS, Android)\n * default: true\n */\n bkmodeEnabled?: boolean;\n /**\n * Show Controls Enable (iOS, Android)\n * default: true\n */\n showControls?: boolean;\n /**\n * Display Mode [\"all\", \"portrait\", \"landscape\"] (iOS, Android)\n * default: \"all\"\n */\n displayMode?: string;\n /**\n * Component Tag or DOM Element Tag (React app)\n */\n componentTag?: string;\n /**\n * Player Width (mode \"embedded\" only)\n */\n width?: number;\n /**\n * Player height (mode \"embedded\" only)\n */\n height?: number;\n /**\n * Headers for the request (iOS, Android)\n * by Manuel García Marín (https://github.com/PhantomPainX)\n */\n headers?: {\n [key: string]: string;\n };\n /**\n * Title shown in the player (Android)\n * by Manuel García Marín (https://github.com/PhantomPainX)\n */\n title?: string;\n /**\n * Subtitle shown below the title in the player (Android)\n * by Manuel García Marín (https://github.com/PhantomPainX)\n */\n smallTitle?: string;\n /**\n * ExoPlayer Progress Bar and Spinner color (Android)\n * by Manuel García Marín (https://github.com/PhantomPainX)\n * Must be a valid hex color code\n * default: #FFFFFF\n */\n accentColor?: string;\n /**\n * Chromecast enable/disable (Android)\n * by Manuel García Marín (https://github.com/PhantomPainX)\n * default: true\n */\n chromecast?: boolean;\n /**\n * Artwork url to be shown in Chromecast player\n * by Manuel García Marín (https://github.com/PhantomPainX)\n * default: \"\"\n */\n artwork?: string;\n}\nexport interface capVideoPlayerIdOptions {\n /**\n * Id of DIV Element parent of the player\n */\n playerId?: string;\n}\nexport interface capVideoRateOptions {\n /**\n * Id of DIV Element parent of the player\n */\n playerId?: string;\n /**\n * Rate value\n */\n rate?: number;\n}\nexport interface capVideoVolumeOptions {\n /**\n * Id of DIV Element parent of the player\n */\n playerId?: string;\n /**\n * Volume value between [0 - 1]\n */\n volume?: number;\n}\nexport interface capVideoTimeOptions {\n /**\n * Id of DIV Element parent of the player\n */\n playerId?: string;\n /**\n * Video time value you want to seek to\n */\n seektime?: number;\n}\nexport interface capVideoMutedOptions {\n /**\n * Id of DIV Element parent of the player\n */\n playerId?: string;\n /**\n * Muted value true or false\n */\n muted?: boolean;\n}\nexport interface capVideoListener {\n /**\n * Id of DIV Element parent of the player\n */\n playerId?: string;\n /**\n * Video current time when listener trigerred\n */\n currentTime?: number;\n}\nexport interface capExitListener {\n /**\n * Dismiss value true or false\n */\n dismiss?: boolean;\n /**\n * Video current time when listener trigerred\n */\n currentTime?: number;\n}\nexport interface capVideoPlayerResult {\n /**\n * result set to true when successful else false\n */\n result?: boolean;\n /**\n * method name\n */\n method?: string;\n /**\n * value returned\n */\n value?: any;\n /**\n * message string\n */\n message?: string;\n}\nexport interface SubTitleOptions {\n /**\n * Foreground Color in RGBA (default rgba(255,255,255,1)\n */\n foregroundColor?: string;\n /**\n * Background Color in RGBA (default rgba(0,0,0,1)\n */\n backgroundColor?: string;\n /**\n * Font Size in pixels (default 16)\n */\n fontSize?: number;\n}\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { registerPlugin } from '@capacitor/core';
|
|
2
|
+
const VideoPlayer = registerPlugin('VideoPlayer', {
|
|
3
|
+
web: () => import('./web').then((m) => new m.VideoPlayerWeb()),
|
|
4
|
+
});
|
|
5
|
+
export * from './definitions';
|
|
6
|
+
export { VideoPlayer };
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,WAAW,GAAG,cAAc,CAAoB,aAAa,EAAE;IACnE,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,cAAc,EAAE,CAAC;CAC/D,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAE,CAAC","sourcesContent":["import { registerPlugin } from '@capacitor/core';\n\nimport type { VideoPlayerPlugin } from './definitions';\n\nconst VideoPlayer = registerPlugin<VideoPlayerPlugin>('VideoPlayer', {\n web: () => import('./web').then((m) => new m.VideoPlayerWeb()),\n});\n\nexport * from './definitions';\nexport { VideoPlayer };\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type videoExtension = 'mp4' | 'webm' | 'cmaf' | 'cmfv' | 'm3u8';
|
|
2
|
+
export type videoMimeType = 'video/mp4' | 'application/x-mpegURL';
|
|
3
|
+
export declare const possibleQueryParameterExtensions: string[];
|
|
4
|
+
export declare const videoTypes: Record<videoExtension, videoMimeType>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export const possibleQueryParameterExtensions = ['file', 'extension', 'filetype', 'type', 'ext'];
|
|
2
|
+
export const videoTypes = {
|
|
3
|
+
mp4: 'video/mp4',
|
|
4
|
+
webm: 'video/mp4',
|
|
5
|
+
cmaf: 'video/mp4',
|
|
6
|
+
cmfv: 'video/mp4',
|
|
7
|
+
m3u8: 'application/x-mpegURL',
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=video-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"video-types.js","sourceRoot":"","sources":["../../../src/web-utils/video-types.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,gCAAgC,GAAa,CAAC,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AAE3G,MAAM,CAAC,MAAM,UAAU,GAA0C;IAC/D,GAAG,EAAE,WAAW;IAChB,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,uBAAuB;CAC9B,CAAC","sourcesContent":["export type videoExtension = 'mp4' | 'webm' | 'cmaf' | 'cmfv' | 'm3u8';\nexport type videoMimeType = 'video/mp4' | 'application/x-mpegURL';\nexport const possibleQueryParameterExtensions: string[] = ['file', 'extension', 'filetype', 'type', 'ext'];\n\nexport const videoTypes: Record<videoExtension, videoMimeType> = {\n mp4: 'video/mp4',\n webm: 'video/mp4',\n cmaf: 'video/mp4',\n cmfv: 'video/mp4',\n m3u8: 'application/x-mpegURL',\n};\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare class VideoPlayer {
|
|
2
|
+
videoEl: HTMLVideoElement | undefined;
|
|
3
|
+
pipMode: boolean;
|
|
4
|
+
pipWindow: Window | undefined;
|
|
5
|
+
isPlaying: boolean | undefined;
|
|
6
|
+
private _url;
|
|
7
|
+
private _playerId;
|
|
8
|
+
private _container;
|
|
9
|
+
private _mode;
|
|
10
|
+
private _width;
|
|
11
|
+
private _height;
|
|
12
|
+
private _zIndex;
|
|
13
|
+
private _initial;
|
|
14
|
+
private _videoType;
|
|
15
|
+
private _videoContainer;
|
|
16
|
+
private _firstReadyToPlay;
|
|
17
|
+
private _isEnded;
|
|
18
|
+
private _videoRate;
|
|
19
|
+
private _videoExitOnEnd;
|
|
20
|
+
private _videoLoopOnEnd;
|
|
21
|
+
constructor(mode: string, url: string, playerId: string, rate: number, exitOnEnd: boolean, loopOnEnd: boolean, container: any, zIndex: number, width?: number, height?: number);
|
|
22
|
+
initialize(): Promise<void>;
|
|
23
|
+
private createVideoElement;
|
|
24
|
+
private _goFullscreen;
|
|
25
|
+
private _setPlayer;
|
|
26
|
+
private _getVideoType;
|
|
27
|
+
private _doHide;
|
|
28
|
+
private _createEvent;
|
|
29
|
+
private _closeFullscreen;
|
|
30
|
+
}
|