@capgo/capacitor-jw-player 0.0.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/CapgoCapacitorJwPlayer.podspec +18 -0
- package/Package.swift +30 -0
- package/README.md +493 -0
- package/android/build.gradle +83 -0
- package/android/src/main/AndroidManifest.xml +37 -0
- package/android/src/main/java/ee/forgr/capacitor_jw_player/JwPlayerPlugin.java +529 -0
- package/android/src/main/java/ee/forgr/capacitor_jw_player/PlayerActivity.java +469 -0
- package/android/src/main/res/.gitkeep +0 -0
- package/android/src/main/res/drawable/close_button_background.xml +5 -0
- package/android/src/main/res/layout/activity_player.xml +28 -0
- package/android/src/main/res/values/colors.xml +16 -0
- package/android/src/main/res/values/strings.xml +3 -0
- package/android/src/main/res/values/styles.xml +32 -0
- package/dist/docs.json +459 -0
- package/dist/esm/definitions.d.ts +156 -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.d.ts +57 -0
- package/dist/esm/web.js +65 -0
- package/dist/esm/web.js.map +1 -0
- package/dist/plugin.cjs.js +79 -0
- package/dist/plugin.cjs.js.map +1 -0
- package/dist/plugin.js +82 -0
- package/dist/plugin.js.map +1 -0
- package/ios/Sources/JwPlayerPlugin/JwPlayer.swift +24 -0
- package/ios/Sources/JwPlayerPlugin/JwPlayerPlugin.swift +749 -0
- package/ios/Sources/JwPlayerPlugin/LinkedList.swift +219 -0
- package/ios/Sources/JwPlayerPlugin/VideosToPlay.swift +56 -0
- package/ios/Tests/JwPlayerPluginTests/JwPlayerPluginTests.swift +15 -0
- package/package.json +80 -0
package/dist/docs.json
ADDED
|
@@ -0,0 +1,459 @@
|
|
|
1
|
+
{
|
|
2
|
+
"api": {
|
|
3
|
+
"name": "JwPlayerPlugin",
|
|
4
|
+
"slug": "jwplayerplugin",
|
|
5
|
+
"docs": "",
|
|
6
|
+
"tags": [],
|
|
7
|
+
"methods": [
|
|
8
|
+
{
|
|
9
|
+
"name": "initialize",
|
|
10
|
+
"signature": "(options: { licenseKey: string; }) => Promise<void>",
|
|
11
|
+
"parameters": [
|
|
12
|
+
{
|
|
13
|
+
"name": "options",
|
|
14
|
+
"docs": "- The options for the JW Player",
|
|
15
|
+
"type": "{ licenseKey: string; }"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"returns": "Promise<void>",
|
|
19
|
+
"tags": [
|
|
20
|
+
{
|
|
21
|
+
"name": "param",
|
|
22
|
+
"text": "options - The options for the JW Player"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"name": "param",
|
|
26
|
+
"text": "options.licenseKey - The license key for the JW Player. Keep in mind that this is different for iOS and Android."
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"name": "returns",
|
|
30
|
+
"text": "A promise that resolves when initialized"
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"docs": "Initialize the JW Player",
|
|
34
|
+
"complexTypes": [],
|
|
35
|
+
"slug": "initialize"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "play",
|
|
39
|
+
"signature": "(options: { mediaUrl: string; mediaType: 'video' | 'playlist'; }) => Promise<void>",
|
|
40
|
+
"parameters": [
|
|
41
|
+
{
|
|
42
|
+
"name": "options",
|
|
43
|
+
"docs": "- The options for the JW Player",
|
|
44
|
+
"type": "{ mediaUrl: string; mediaType: 'video' | 'playlist'; }"
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
"returns": "Promise<void>",
|
|
48
|
+
"tags": [
|
|
49
|
+
{
|
|
50
|
+
"name": "param",
|
|
51
|
+
"text": "options - The options for the JW Player"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"name": "param",
|
|
55
|
+
"text": "options.mediaUrl - The URL of the media to play"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"name": "param",
|
|
59
|
+
"text": "options.mediaType - The type of media to play"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"name": "returns",
|
|
63
|
+
"text": "A promise that resolves when the command is executed"
|
|
64
|
+
}
|
|
65
|
+
],
|
|
66
|
+
"docs": "Play a video",
|
|
67
|
+
"complexTypes": [],
|
|
68
|
+
"slug": "play"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"name": "pause",
|
|
72
|
+
"signature": "() => Promise<void>",
|
|
73
|
+
"parameters": [],
|
|
74
|
+
"returns": "Promise<void>",
|
|
75
|
+
"tags": [
|
|
76
|
+
{
|
|
77
|
+
"name": "returns",
|
|
78
|
+
"text": "A promise that resolves when the command is executed"
|
|
79
|
+
}
|
|
80
|
+
],
|
|
81
|
+
"docs": "Pause the currently playing media",
|
|
82
|
+
"complexTypes": [],
|
|
83
|
+
"slug": "pause"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"name": "resume",
|
|
87
|
+
"signature": "() => Promise<void>",
|
|
88
|
+
"parameters": [],
|
|
89
|
+
"returns": "Promise<void>",
|
|
90
|
+
"tags": [
|
|
91
|
+
{
|
|
92
|
+
"name": "returns",
|
|
93
|
+
"text": "A promise that resolves when the command is executed"
|
|
94
|
+
}
|
|
95
|
+
],
|
|
96
|
+
"docs": "Resume the currently paused media",
|
|
97
|
+
"complexTypes": [],
|
|
98
|
+
"slug": "resume"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"name": "stop",
|
|
102
|
+
"signature": "() => Promise<void>",
|
|
103
|
+
"parameters": [],
|
|
104
|
+
"returns": "Promise<void>",
|
|
105
|
+
"tags": [
|
|
106
|
+
{
|
|
107
|
+
"name": "returns",
|
|
108
|
+
"text": "A promise that resolves when the command is executed"
|
|
109
|
+
}
|
|
110
|
+
],
|
|
111
|
+
"docs": "Stop the currently playing media",
|
|
112
|
+
"complexTypes": [],
|
|
113
|
+
"slug": "stop"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"name": "seekTo",
|
|
117
|
+
"signature": "(options: { time: number; }) => Promise<void>",
|
|
118
|
+
"parameters": [
|
|
119
|
+
{
|
|
120
|
+
"name": "options",
|
|
121
|
+
"docs": "- Options for seeking",
|
|
122
|
+
"type": "{ time: number; }"
|
|
123
|
+
}
|
|
124
|
+
],
|
|
125
|
+
"returns": "Promise<void>",
|
|
126
|
+
"tags": [
|
|
127
|
+
{
|
|
128
|
+
"name": "param",
|
|
129
|
+
"text": "options - Options for seeking"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"name": "param",
|
|
133
|
+
"text": "options.time - The position to seek to in seconds"
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"name": "returns",
|
|
137
|
+
"text": "A promise that resolves when the command is executed"
|
|
138
|
+
}
|
|
139
|
+
],
|
|
140
|
+
"docs": "Seek to a specific position in the currently playing media",
|
|
141
|
+
"complexTypes": [],
|
|
142
|
+
"slug": "seekto"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"name": "setVolume",
|
|
146
|
+
"signature": "(options: { volume: number; }) => Promise<void>",
|
|
147
|
+
"parameters": [
|
|
148
|
+
{
|
|
149
|
+
"name": "options",
|
|
150
|
+
"docs": "- Options for setting volume",
|
|
151
|
+
"type": "{ volume: number; }"
|
|
152
|
+
}
|
|
153
|
+
],
|
|
154
|
+
"returns": "Promise<void>",
|
|
155
|
+
"tags": [
|
|
156
|
+
{
|
|
157
|
+
"name": "param",
|
|
158
|
+
"text": "options - Options for setting volume"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"name": "param",
|
|
162
|
+
"text": "options.volume - The volume level (0.0 to 1.0)"
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"name": "returns",
|
|
166
|
+
"text": "A promise that resolves when the command is executed"
|
|
167
|
+
}
|
|
168
|
+
],
|
|
169
|
+
"docs": "Set the volume level",
|
|
170
|
+
"complexTypes": [],
|
|
171
|
+
"slug": "setvolume"
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"name": "getPosition",
|
|
175
|
+
"signature": "() => Promise<{ position: number; }>",
|
|
176
|
+
"parameters": [],
|
|
177
|
+
"returns": "Promise<{ position: number; }>",
|
|
178
|
+
"tags": [
|
|
179
|
+
{
|
|
180
|
+
"name": "returns",
|
|
181
|
+
"text": "A promise that resolves with the current position in seconds"
|
|
182
|
+
}
|
|
183
|
+
],
|
|
184
|
+
"docs": "Get the current position in the media",
|
|
185
|
+
"complexTypes": [],
|
|
186
|
+
"slug": "getposition"
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
"name": "getState",
|
|
190
|
+
"signature": "() => Promise<{ state: number; }>",
|
|
191
|
+
"parameters": [],
|
|
192
|
+
"returns": "Promise<{ state: number; }>",
|
|
193
|
+
"tags": [
|
|
194
|
+
{
|
|
195
|
+
"name": "returns",
|
|
196
|
+
"text": "A promise that resolves with the player state"
|
|
197
|
+
}
|
|
198
|
+
],
|
|
199
|
+
"docs": "Get the current player state",
|
|
200
|
+
"complexTypes": [],
|
|
201
|
+
"slug": "getstate"
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
"name": "setSpeed",
|
|
205
|
+
"signature": "(options: { speed: number; }) => Promise<void>",
|
|
206
|
+
"parameters": [
|
|
207
|
+
{
|
|
208
|
+
"name": "options",
|
|
209
|
+
"docs": "- Options for setting speed",
|
|
210
|
+
"type": "{ speed: number; }"
|
|
211
|
+
}
|
|
212
|
+
],
|
|
213
|
+
"returns": "Promise<void>",
|
|
214
|
+
"tags": [
|
|
215
|
+
{
|
|
216
|
+
"name": "param",
|
|
217
|
+
"text": "options - Options for setting speed"
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
"name": "param",
|
|
221
|
+
"text": "options.speed - The playback speed (0.5 to 2.0)"
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
"name": "returns",
|
|
225
|
+
"text": "A promise that resolves when the command is executed"
|
|
226
|
+
}
|
|
227
|
+
],
|
|
228
|
+
"docs": "Set the playback speed",
|
|
229
|
+
"complexTypes": [],
|
|
230
|
+
"slug": "setspeed"
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
"name": "setPlaylistIndex",
|
|
234
|
+
"signature": "(options: { index: number; }) => Promise<void>",
|
|
235
|
+
"parameters": [
|
|
236
|
+
{
|
|
237
|
+
"name": "options",
|
|
238
|
+
"docs": "- Options for setting playlist item",
|
|
239
|
+
"type": "{ index: number; }"
|
|
240
|
+
}
|
|
241
|
+
],
|
|
242
|
+
"returns": "Promise<void>",
|
|
243
|
+
"tags": [
|
|
244
|
+
{
|
|
245
|
+
"name": "param",
|
|
246
|
+
"text": "options - Options for setting playlist item"
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
"name": "param",
|
|
250
|
+
"text": "options.index - The index of the item to play"
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
"name": "returns",
|
|
254
|
+
"text": "A promise that resolves when the command is executed"
|
|
255
|
+
}
|
|
256
|
+
],
|
|
257
|
+
"docs": "Set the current item in the playlist by index",
|
|
258
|
+
"complexTypes": [],
|
|
259
|
+
"slug": "setplaylistindex"
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
"name": "loadPlaylist",
|
|
263
|
+
"signature": "(options: { playlistUrl: string; }) => Promise<void>",
|
|
264
|
+
"parameters": [
|
|
265
|
+
{
|
|
266
|
+
"name": "options",
|
|
267
|
+
"docs": "- Options for loading a playlist",
|
|
268
|
+
"type": "{ playlistUrl: string; }"
|
|
269
|
+
}
|
|
270
|
+
],
|
|
271
|
+
"returns": "Promise<void>",
|
|
272
|
+
"tags": [
|
|
273
|
+
{
|
|
274
|
+
"name": "param",
|
|
275
|
+
"text": "options - Options for loading a playlist"
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
"name": "param",
|
|
279
|
+
"text": "options.playlistUrl - The URL of the playlist"
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
"name": "returns",
|
|
283
|
+
"text": "A promise that resolves when the command is executed"
|
|
284
|
+
}
|
|
285
|
+
],
|
|
286
|
+
"docs": "Load a playlist",
|
|
287
|
+
"complexTypes": [],
|
|
288
|
+
"slug": "loadplaylist"
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
"name": "loadPlaylistWithItems",
|
|
292
|
+
"signature": "(options: { playlist: any[]; }) => Promise<void>",
|
|
293
|
+
"parameters": [
|
|
294
|
+
{
|
|
295
|
+
"name": "options",
|
|
296
|
+
"docs": "- Options for loading a playlist",
|
|
297
|
+
"type": "{ playlist: any[]; }"
|
|
298
|
+
}
|
|
299
|
+
],
|
|
300
|
+
"returns": "Promise<void>",
|
|
301
|
+
"tags": [
|
|
302
|
+
{
|
|
303
|
+
"name": "param",
|
|
304
|
+
"text": "options - Options for loading a playlist"
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
"name": "param",
|
|
308
|
+
"text": "options.playlist - Array of playlist items"
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
"name": "returns",
|
|
312
|
+
"text": "A promise that resolves when the command is executed"
|
|
313
|
+
}
|
|
314
|
+
],
|
|
315
|
+
"docs": "Load a playlist with items",
|
|
316
|
+
"complexTypes": [],
|
|
317
|
+
"slug": "loadplaylistwithitems"
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
"name": "getAudioTracks",
|
|
321
|
+
"signature": "() => Promise<{ tracks: any[]; }>",
|
|
322
|
+
"parameters": [],
|
|
323
|
+
"returns": "Promise<{ tracks: any[]; }>",
|
|
324
|
+
"tags": [
|
|
325
|
+
{
|
|
326
|
+
"name": "returns",
|
|
327
|
+
"text": "A promise that resolves with available audio tracks"
|
|
328
|
+
}
|
|
329
|
+
],
|
|
330
|
+
"docs": "Get available audio tracks",
|
|
331
|
+
"complexTypes": [],
|
|
332
|
+
"slug": "getaudiotracks"
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
"name": "getCurrentAudioTrack",
|
|
336
|
+
"signature": "() => Promise<{ index: number; }>",
|
|
337
|
+
"parameters": [],
|
|
338
|
+
"returns": "Promise<{ index: number; }>",
|
|
339
|
+
"tags": [
|
|
340
|
+
{
|
|
341
|
+
"name": "returns",
|
|
342
|
+
"text": "A promise that resolves with current audio track index"
|
|
343
|
+
}
|
|
344
|
+
],
|
|
345
|
+
"docs": "Get the current audio track",
|
|
346
|
+
"complexTypes": [],
|
|
347
|
+
"slug": "getcurrentaudiotrack"
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
"name": "setCurrentAudioTrack",
|
|
351
|
+
"signature": "(options: { index: number; }) => Promise<void>",
|
|
352
|
+
"parameters": [
|
|
353
|
+
{
|
|
354
|
+
"name": "options",
|
|
355
|
+
"docs": "- Options for setting audio track",
|
|
356
|
+
"type": "{ index: number; }"
|
|
357
|
+
}
|
|
358
|
+
],
|
|
359
|
+
"returns": "Promise<void>",
|
|
360
|
+
"tags": [
|
|
361
|
+
{
|
|
362
|
+
"name": "param",
|
|
363
|
+
"text": "options - Options for setting audio track"
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
"name": "param",
|
|
367
|
+
"text": "options.index - The index of the audio track"
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
"name": "returns",
|
|
371
|
+
"text": "A promise that resolves when the command is executed"
|
|
372
|
+
}
|
|
373
|
+
],
|
|
374
|
+
"docs": "Set the current audio track",
|
|
375
|
+
"complexTypes": [],
|
|
376
|
+
"slug": "setcurrentaudiotrack"
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
"name": "getCaptions",
|
|
380
|
+
"signature": "() => Promise<{ captions: any[]; }>",
|
|
381
|
+
"parameters": [],
|
|
382
|
+
"returns": "Promise<{ captions: any[]; }>",
|
|
383
|
+
"tags": [
|
|
384
|
+
{
|
|
385
|
+
"name": "returns",
|
|
386
|
+
"text": "A promise that resolves with available captions"
|
|
387
|
+
}
|
|
388
|
+
],
|
|
389
|
+
"docs": "Get the available captions/subtitles",
|
|
390
|
+
"complexTypes": [],
|
|
391
|
+
"slug": "getcaptions"
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
"name": "getCurrentCaptions",
|
|
395
|
+
"signature": "() => Promise<{ index: number; }>",
|
|
396
|
+
"parameters": [],
|
|
397
|
+
"returns": "Promise<{ index: number; }>",
|
|
398
|
+
"tags": [
|
|
399
|
+
{
|
|
400
|
+
"name": "returns",
|
|
401
|
+
"text": "A promise that resolves with current captions track index"
|
|
402
|
+
}
|
|
403
|
+
],
|
|
404
|
+
"docs": "Get the current captions/subtitles track",
|
|
405
|
+
"complexTypes": [],
|
|
406
|
+
"slug": "getcurrentcaptions"
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
"name": "setCurrentCaptions",
|
|
410
|
+
"signature": "(options: { index: number; }) => Promise<void>",
|
|
411
|
+
"parameters": [
|
|
412
|
+
{
|
|
413
|
+
"name": "options",
|
|
414
|
+
"docs": "- Options for setting captions track",
|
|
415
|
+
"type": "{ index: number; }"
|
|
416
|
+
}
|
|
417
|
+
],
|
|
418
|
+
"returns": "Promise<void>",
|
|
419
|
+
"tags": [
|
|
420
|
+
{
|
|
421
|
+
"name": "param",
|
|
422
|
+
"text": "options - Options for setting captions track"
|
|
423
|
+
},
|
|
424
|
+
{
|
|
425
|
+
"name": "param",
|
|
426
|
+
"text": "options.index - The index of the captions track"
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
"name": "returns",
|
|
430
|
+
"text": "A promise that resolves when the command is executed"
|
|
431
|
+
}
|
|
432
|
+
],
|
|
433
|
+
"docs": "Set the current captions/subtitles track",
|
|
434
|
+
"complexTypes": [],
|
|
435
|
+
"slug": "setcurrentcaptions"
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
"name": "currentPlaylist",
|
|
439
|
+
"signature": "() => Promise<any>",
|
|
440
|
+
"parameters": [],
|
|
441
|
+
"returns": "Promise<any>",
|
|
442
|
+
"tags": [
|
|
443
|
+
{
|
|
444
|
+
"name": "returns",
|
|
445
|
+
"text": "A promise that resolves to the current playlist"
|
|
446
|
+
}
|
|
447
|
+
],
|
|
448
|
+
"docs": "Get the current playlist",
|
|
449
|
+
"complexTypes": [],
|
|
450
|
+
"slug": "currentplaylist"
|
|
451
|
+
}
|
|
452
|
+
],
|
|
453
|
+
"properties": []
|
|
454
|
+
},
|
|
455
|
+
"interfaces": [],
|
|
456
|
+
"enums": [],
|
|
457
|
+
"typeAliases": [],
|
|
458
|
+
"pluginConfigs": []
|
|
459
|
+
}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
export interface JwPlayerPlugin {
|
|
2
|
+
/**
|
|
3
|
+
* Initialize the JW Player
|
|
4
|
+
* @param options - The options for the JW Player
|
|
5
|
+
* @param options.licenseKey - The license key for the JW Player. Keep in mind that this is different for iOS and Android.
|
|
6
|
+
* @returns A promise that resolves when initialized
|
|
7
|
+
*/
|
|
8
|
+
initialize(options: {
|
|
9
|
+
licenseKey: string;
|
|
10
|
+
}): Promise<void>;
|
|
11
|
+
/**
|
|
12
|
+
* Play a video
|
|
13
|
+
* @param options - The options for the JW Player
|
|
14
|
+
* @param options.mediaUrl - The URL of the media to play
|
|
15
|
+
* @param options.mediaType - The type of media to play
|
|
16
|
+
* @returns A promise that resolves when the command is executed
|
|
17
|
+
*/
|
|
18
|
+
play(options: {
|
|
19
|
+
mediaUrl: string;
|
|
20
|
+
mediaType: 'video' | 'playlist';
|
|
21
|
+
}): Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
* Pause the currently playing media
|
|
24
|
+
* @returns A promise that resolves when the command is executed
|
|
25
|
+
*/
|
|
26
|
+
pause(): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Resume the currently paused media
|
|
29
|
+
* @returns A promise that resolves when the command is executed
|
|
30
|
+
*/
|
|
31
|
+
resume(): Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* Stop the currently playing media
|
|
34
|
+
* @returns A promise that resolves when the command is executed
|
|
35
|
+
*/
|
|
36
|
+
stop(): Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* Seek to a specific position in the currently playing media
|
|
39
|
+
* @param options - Options for seeking
|
|
40
|
+
* @param options.time - The position to seek to in seconds
|
|
41
|
+
* @returns A promise that resolves when the command is executed
|
|
42
|
+
*/
|
|
43
|
+
seekTo(options: {
|
|
44
|
+
time: number;
|
|
45
|
+
}): Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
* Set the volume level
|
|
48
|
+
* @param options - Options for setting volume
|
|
49
|
+
* @param options.volume - The volume level (0.0 to 1.0)
|
|
50
|
+
* @returns A promise that resolves when the command is executed
|
|
51
|
+
*/
|
|
52
|
+
setVolume(options: {
|
|
53
|
+
volume: number;
|
|
54
|
+
}): Promise<void>;
|
|
55
|
+
/**
|
|
56
|
+
* Get the current position in the media
|
|
57
|
+
* @returns A promise that resolves with the current position in seconds
|
|
58
|
+
*/
|
|
59
|
+
getPosition(): Promise<{
|
|
60
|
+
position: number;
|
|
61
|
+
}>;
|
|
62
|
+
/**
|
|
63
|
+
* Get the current player state
|
|
64
|
+
* @returns A promise that resolves with the player state
|
|
65
|
+
*/
|
|
66
|
+
getState(): Promise<{
|
|
67
|
+
state: number;
|
|
68
|
+
}>;
|
|
69
|
+
/**
|
|
70
|
+
* Set the playback speed
|
|
71
|
+
* @param options - Options for setting speed
|
|
72
|
+
* @param options.speed - The playback speed (0.5 to 2.0)
|
|
73
|
+
* @returns A promise that resolves when the command is executed
|
|
74
|
+
*/
|
|
75
|
+
setSpeed(options: {
|
|
76
|
+
speed: number;
|
|
77
|
+
}): Promise<void>;
|
|
78
|
+
/**
|
|
79
|
+
* Set the current item in the playlist by index
|
|
80
|
+
* @param options - Options for setting playlist item
|
|
81
|
+
* @param options.index - The index of the item to play
|
|
82
|
+
* @returns A promise that resolves when the command is executed
|
|
83
|
+
*/
|
|
84
|
+
setPlaylistIndex(options: {
|
|
85
|
+
index: number;
|
|
86
|
+
}): Promise<void>;
|
|
87
|
+
/**
|
|
88
|
+
* Load a playlist
|
|
89
|
+
* @param options - Options for loading a playlist
|
|
90
|
+
* @param options.playlistUrl - The URL of the playlist
|
|
91
|
+
* @returns A promise that resolves when the command is executed
|
|
92
|
+
*/
|
|
93
|
+
loadPlaylist(options: {
|
|
94
|
+
playlistUrl: string;
|
|
95
|
+
}): Promise<void>;
|
|
96
|
+
/**
|
|
97
|
+
* Load a playlist with items
|
|
98
|
+
* @param options - Options for loading a playlist
|
|
99
|
+
* @param options.playlist - Array of playlist items
|
|
100
|
+
* @returns A promise that resolves when the command is executed
|
|
101
|
+
*/
|
|
102
|
+
loadPlaylistWithItems(options: {
|
|
103
|
+
playlist: any[];
|
|
104
|
+
}): Promise<void>;
|
|
105
|
+
/**
|
|
106
|
+
* Get available audio tracks
|
|
107
|
+
* @returns A promise that resolves with available audio tracks
|
|
108
|
+
*/
|
|
109
|
+
getAudioTracks(): Promise<{
|
|
110
|
+
tracks: any[];
|
|
111
|
+
}>;
|
|
112
|
+
/**
|
|
113
|
+
* Get the current audio track
|
|
114
|
+
* @returns A promise that resolves with current audio track index
|
|
115
|
+
*/
|
|
116
|
+
getCurrentAudioTrack(): Promise<{
|
|
117
|
+
index: number;
|
|
118
|
+
}>;
|
|
119
|
+
/**
|
|
120
|
+
* Set the current audio track
|
|
121
|
+
* @param options - Options for setting audio track
|
|
122
|
+
* @param options.index - The index of the audio track
|
|
123
|
+
* @returns A promise that resolves when the command is executed
|
|
124
|
+
*/
|
|
125
|
+
setCurrentAudioTrack(options: {
|
|
126
|
+
index: number;
|
|
127
|
+
}): Promise<void>;
|
|
128
|
+
/**
|
|
129
|
+
* Get the available captions/subtitles
|
|
130
|
+
* @returns A promise that resolves with available captions
|
|
131
|
+
*/
|
|
132
|
+
getCaptions(): Promise<{
|
|
133
|
+
captions: any[];
|
|
134
|
+
}>;
|
|
135
|
+
/**
|
|
136
|
+
* Get the current captions/subtitles track
|
|
137
|
+
* @returns A promise that resolves with current captions track index
|
|
138
|
+
*/
|
|
139
|
+
getCurrentCaptions(): Promise<{
|
|
140
|
+
index: number;
|
|
141
|
+
}>;
|
|
142
|
+
/**
|
|
143
|
+
* Set the current captions/subtitles track
|
|
144
|
+
* @param options - Options for setting captions track
|
|
145
|
+
* @param options.index - The index of the captions track
|
|
146
|
+
* @returns A promise that resolves when the command is executed
|
|
147
|
+
*/
|
|
148
|
+
setCurrentCaptions(options: {
|
|
149
|
+
index: number;
|
|
150
|
+
}): Promise<void>;
|
|
151
|
+
/**
|
|
152
|
+
* Get the current playlist
|
|
153
|
+
* @returns A promise that resolves to the current playlist
|
|
154
|
+
*/
|
|
155
|
+
currentPlaylist(): Promise<any>;
|
|
156
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["export interface JwPlayerPlugin {\n /**\n * Initialize the JW Player\n * @param options - The options for the JW Player\n * @param options.licenseKey - The license key for the JW Player. Keep in mind that this is different for iOS and Android.\n * @returns A promise that resolves when initialized\n */\n initialize(options: { licenseKey: string }): Promise<void>;\n \n /**\n * Play a video\n * @param options - The options for the JW Player\n * @param options.mediaUrl - The URL of the media to play\n * @param options.mediaType - The type of media to play\n * @returns A promise that resolves when the command is executed\n */\n play(options: { \n mediaUrl: string \n mediaType: 'video' | 'playlist'\n }): Promise<void>;\n\n /**\n * Pause the currently playing media\n * @returns A promise that resolves when the command is executed\n */\n pause(): Promise<void>;\n\n /**\n * Resume the currently paused media\n * @returns A promise that resolves when the command is executed\n */\n resume(): Promise<void>;\n\n /**\n * Stop the currently playing media\n * @returns A promise that resolves when the command is executed\n */\n stop(): Promise<void>;\n\n /**\n * Seek to a specific position in the currently playing media\n * @param options - Options for seeking\n * @param options.time - The position to seek to in seconds\n * @returns A promise that resolves when the command is executed\n */\n seekTo(options: { time: number }): Promise<void>;\n\n /**\n * Set the volume level\n * @param options - Options for setting volume\n * @param options.volume - The volume level (0.0 to 1.0)\n * @returns A promise that resolves when the command is executed\n */\n setVolume(options: { volume: number }): Promise<void>;\n\n /**\n * Get the current position in the media\n * @returns A promise that resolves with the current position in seconds\n */\n getPosition(): Promise<{ position: number }>;\n\n /**\n * Get the current player state\n * @returns A promise that resolves with the player state\n */\n getState(): Promise<{ state: number }>;\n\n /**\n * Set the playback speed\n * @param options - Options for setting speed\n * @param options.speed - The playback speed (0.5 to 2.0)\n * @returns A promise that resolves when the command is executed\n */\n setSpeed(options: { speed: number }): Promise<void>;\n\n /**\n * Set the current item in the playlist by index\n * @param options - Options for setting playlist item\n * @param options.index - The index of the item to play\n * @returns A promise that resolves when the command is executed\n */\n setPlaylistIndex(options: { index: number }): Promise<void>;\n\n /**\n * Load a playlist\n * @param options - Options for loading a playlist\n * @param options.playlistUrl - The URL of the playlist\n * @returns A promise that resolves when the command is executed\n */\n loadPlaylist(options: { playlistUrl: string }): Promise<void>;\n\n /**\n * Load a playlist with items\n * @param options - Options for loading a playlist\n * @param options.playlist - Array of playlist items\n * @returns A promise that resolves when the command is executed\n */\n loadPlaylistWithItems(options: { playlist: any[] }): Promise<void>;\n\n /**\n * Get available audio tracks\n * @returns A promise that resolves with available audio tracks\n */\n getAudioTracks(): Promise<{ tracks: any[] }>;\n \n /**\n * Get the current audio track\n * @returns A promise that resolves with current audio track index\n */\n getCurrentAudioTrack(): Promise<{ index: number }>;\n\n /**\n * Set the current audio track\n * @param options - Options for setting audio track\n * @param options.index - The index of the audio track\n * @returns A promise that resolves when the command is executed\n */\n setCurrentAudioTrack(options: { index: number }): Promise<void>;\n\n /**\n * Get the available captions/subtitles\n * @returns A promise that resolves with available captions\n */\n getCaptions(): Promise<{ captions: any[] }>;\n\n /**\n * Get the current captions/subtitles track\n * @returns A promise that resolves with current captions track index\n */\n getCurrentCaptions(): Promise<{ index: number }>;\n\n /**\n * Set the current captions/subtitles track\n * @param options - Options for setting captions track\n * @param options.index - The index of the captions track\n * @returns A promise that resolves when the command is executed\n */\n setCurrentCaptions(options: { index: number }): Promise<void>;\n\n /**\n * Get the current playlist\n * @returns A promise that resolves to the current playlist\n */\n currentPlaylist(): Promise<any>;\n}\n"]}
|
|
@@ -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,QAAQ,GAAG,cAAc,CAAiB,UAAU,EAAE;IAC1D,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC;CAC5D,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,CAAC","sourcesContent":["import { registerPlugin } from '@capacitor/core';\n\nimport type { JwPlayerPlugin } from './definitions';\n\nconst JwPlayer = registerPlugin<JwPlayerPlugin>('JwPlayer', {\n web: () => import('./web').then((m) => new m.JwPlayerWeb()),\n});\n\nexport * from './definitions';\nexport { JwPlayer };\n"]}
|