@gcorevideo/player 2.20.3 → 2.20.4
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/dist/core.js +30 -6
- package/dist/index.css +859 -859
- package/dist/index.js +39 -10
- package/dist/player.d.ts +10 -0
- package/dist/plugins/index.css +954 -954
- package/dist/plugins/index.js +10 -5
- package/docs/api/player.contextmenupluginsettings.label.md +3 -0
- package/docs/api/player.contextmenupluginsettings.md +8 -3
- package/docs/api/player.contextmenupluginsettings.preventshowcontextmenu.md +3 -0
- package/docs/api/player.contextmenupluginsettings.url.md +3 -0
- package/docs/api/player.md +6 -2
- package/docs/api/player.multicamera._constructor_.md +3 -0
- package/docs/api/player.multicamera.activebyid.md +3 -0
- package/docs/api/player.multicamera.attributes.md +3 -0
- package/docs/api/player.multicamera.bindevents.md +3 -0
- package/docs/api/player.multicamera.events.md +3 -0
- package/docs/api/player.multicamera.getcameraslist.md +3 -0
- package/docs/api/player.multicamera.getcurrentcamera.md +3 -0
- package/docs/api/player.multicamera.md +28 -1
- package/docs/api/player.multicamera.name.md +3 -0
- package/docs/api/player.multicamera.render.md +3 -0
- package/docs/api/player.multicamera.supportedversion.md +3 -0
- package/docs/api/player.multicamera.template.md +3 -0
- package/docs/api/player.multicamera.unbindevents.md +3 -0
- package/docs/api/player.multicamera.version.md +3 -0
- package/docs/api/player.volumefadeevents.md +7 -0
- package/docs/api/player.zeptoresult.md +1 -0
- package/lib/Player.d.ts +5 -3
- package/lib/Player.d.ts.map +1 -1
- package/lib/Player.js +30 -6
- package/lib/internal.types.d.ts +7 -7
- package/lib/internal.types.d.ts.map +1 -1
- package/lib/plugins/context-menu/ContextMenu.d.ts +4 -0
- package/lib/plugins/context-menu/ContextMenu.d.ts.map +1 -1
- package/lib/plugins/multi-camera/MultiCamera.d.ts +1 -0
- package/lib/plugins/multi-camera/MultiCamera.d.ts.map +1 -1
- package/lib/plugins/multi-camera/MultiCamera.js +3 -2
- package/lib/plugins/seek-time/SeekTime.js +1 -1
- package/lib/plugins/share/Share.js +1 -1
- package/lib/plugins/volume-fade/VolumeFade.d.ts +4 -0
- package/lib/plugins/volume-fade/VolumeFade.d.ts.map +1 -1
- package/lib/plugins/volume-fade/VolumeFade.js +4 -0
- package/lib/types.d.ts +9 -1
- package/lib/types.d.ts.map +1 -1
- package/lib/utils/types.d.ts +1 -0
- package/lib/utils/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/release_notes +297 -0
- package/src/Player.ts +101 -46
- package/src/__tests__/Player.test.ts +23 -1
- package/src/internal.types.ts +86 -79
- package/src/plugins/context-menu/ContextMenu.ts +4 -0
- package/src/plugins/multi-camera/MultiCamera.ts +3 -2
- package/src/plugins/seek-time/SeekTime.ts +1 -1
- package/src/plugins/share/Share.ts +1 -1
- package/src/plugins/volume-fade/VolumeFade.ts +4 -0
- package/src/types.ts +11 -1
- package/src/utils/types.ts +1 -0
- package/temp/player.api.json +24 -24
- package/tsconfig.tsbuildinfo +1 -1
package/dist/plugins/index.js
CHANGED
|
@@ -35958,7 +35958,7 @@ class ClipsPlugin extends UICorePlugin {
|
|
|
35958
35958
|
|
|
35959
35959
|
const templateHtml$1 = "<ul class=\"context-menu-list\">\n <% if(options) { %>\n <% for (var i = 0; i < options.length; i++) { %>\n <li class=\"context-menu-list-item <%= options[i].class %>\"\n data-<%= options[i].name %>><%= options[i].label %></li>\n <% } %>\n <% } %>\n</ul>\n";
|
|
35960
35960
|
|
|
35961
|
-
var version$1 = "2.20.
|
|
35961
|
+
var version$1 = "2.20.4";
|
|
35962
35962
|
|
|
35963
35963
|
var packages = {
|
|
35964
35964
|
"node_modules/@clappr/core": {
|
|
@@ -38422,9 +38422,10 @@ const streamsMomentoIcon = "<svg id=\"Слой_1\" data-name=\"Слой 1\" xmln
|
|
|
38422
38422
|
const streamsWhiteNightsIcon = "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"50\" height=\"50\" viewBox=\"0 0 50 50\">\n <defs>\n <clipPath id=\"clip-Icon\">\n <rect width=\"50\" height=\"50\"/>\n </clipPath>\n </defs>\n <g id=\"Icon\" clip-path=\"url(#clip-Icon)\">\n <g id=\"icon2\" transform=\"translate(-0.041 0)\">\n <path id=\"Контур_77\" data-name=\"Контур 77\" d=\"M6.493,13v8.266h6.275V19.74H8.31V17.714h4.006V16.3H8.31V14.53h4.365V13Zm7.5,0v8.266h1.7V15.732h.023l3.438,5.534h1.818V13h-1.7v5.545h-.023L15.8,13Z\" fill=\"#fff\"/>\n <path id=\"Контур_76\" data-name=\"Контур 76\" d=\"M29.949,29.1V26.774H31.94a1.4,1.4,0,0,1,.938.272,1.1,1.1,0,0,1,.313.874,1.155,1.155,0,0,1-.313.9,1.375,1.375,0,0,1-.938.278ZM28.132,25.36v8.266h1.817V30.4h1.818a1.353,1.353,0,0,1,.984.3,1.637,1.637,0,0,1,.394.949c.046.333.079.681.1,1.042a3.2,3.2,0,0,0,.185.938h1.819a1.218,1.218,0,0,1-.191-.423,3.611,3.611,0,0,1-.093-.527c-.019-.185-.033-.367-.041-.544s-.016-.332-.023-.463a5.052,5.052,0,0,0-.087-.625,2.109,2.109,0,0,0-.2-.573,1.586,1.586,0,0,0-.359-.451,1.414,1.414,0,0,0-.556-.284v-.023a1.926,1.926,0,0,0,1-.81,2.494,2.494,0,0,0,.307-1.262,2.308,2.308,0,0,0-.165-.88,2.128,2.128,0,0,0-.486-.724,2.3,2.3,0,0,0-.764-.492,2.67,2.67,0,0,0-1-.179ZM43.506,30.5V25.36H41.689V30.5a2.065,2.065,0,0,1-.37,1.36,1.7,1.7,0,0,1-1.343.434,2.086,2.086,0,0,1-.886-.156,1.283,1.283,0,0,1-.758-.978,3.748,3.748,0,0,1-.058-.66V25.36H36.456V30.5a3.16,3.16,0,0,0,.92,2.5,3.807,3.807,0,0,0,2.6.81,3.82,3.82,0,0,0,2.593-.816,3.132,3.132,0,0,0,.937-2.492Z\" fill=\"#fff\"/>\n <path id=\"Контур_80\" data-name=\"Контур 80\" d=\"M22.646,31.2H4.689a4.505,4.505,0,0,1-4.5-4.5V8.5A4.505,4.505,0,0,1,4.689,4h18.2a4.505,4.505,0,0,1,4.5,4.5v8.445l-.893.1a3.184,3.184,0,0,0-2.846,3.177V30.5l-.465.7ZM4.689,6a2.5,2.5,0,0,0-2.5,2.5V26.7a2.5,2.5,0,0,0,2.5,2.5H21.65V20.22a5.18,5.18,0,0,1,3.739-4.992V8.5a2.5,2.5,0,0,0-2.5-2.5Z\" fill=\"#fff\"/>\n <path id=\"Контур_81\" data-name=\"Контур 81\" d=\"M30.127,47.884a1,1,0,0,1-1-1V43.267H26.846a5.206,5.206,0,0,1-5.2-5.2V20.222a5.206,5.206,0,0,1,5.2-5.2H44.692a5.206,5.206,0,0,1,5.2,5.2V38.068a5.206,5.206,0,0,1-5.2,5.2H35.058l-4.216,4.316A1,1,0,0,1,30.127,47.884ZM26.846,17.022a3.2,3.2,0,0,0-3.2,3.2V38.067a3.2,3.2,0,0,0,3.2,3.2h3.281a1,1,0,0,1,1,1v2.162l2.8-2.86a1,1,0,0,1,.715-.3H44.692a3.2,3.2,0,0,0,3.2-3.2V20.222a3.2,3.2,0,0,0-3.2-3.2Z\" fill=\"#fff\"/>\n </g>\n </g>\n</svg>\n";
|
|
38423
38423
|
|
|
38424
38424
|
const VERSION$3 = '0.0.1';
|
|
38425
|
-
const T$7 = 'plugins.
|
|
38425
|
+
const T$7 = 'plugins.multicamera';
|
|
38426
38426
|
/**
|
|
38427
38427
|
* The plugin adds support for loading multiple streams and switching between them using the media control UI.
|
|
38428
|
+
* @beta
|
|
38428
38429
|
*/
|
|
38429
38430
|
class MultiCamera extends UICorePlugin {
|
|
38430
38431
|
currentCamera = null;
|
|
@@ -38433,7 +38434,7 @@ class MultiCamera extends UICorePlugin {
|
|
|
38433
38434
|
multicamera = [];
|
|
38434
38435
|
noActiveStreams = false;
|
|
38435
38436
|
get name() {
|
|
38436
|
-
return '
|
|
38437
|
+
return 'multicamera';
|
|
38437
38438
|
}
|
|
38438
38439
|
get supportedVersion() {
|
|
38439
38440
|
return { min: CLAPPR_VERSION };
|
|
@@ -39370,7 +39371,7 @@ const { formatTime } = Utils;
|
|
|
39370
39371
|
*/
|
|
39371
39372
|
class SeekTime extends UICorePlugin {
|
|
39372
39373
|
get name() {
|
|
39373
|
-
return '
|
|
39374
|
+
return 'seek_time';
|
|
39374
39375
|
}
|
|
39375
39376
|
get supportedVersion() {
|
|
39376
39377
|
return { min: CLAPPR_VERSION };
|
|
@@ -39531,7 +39532,7 @@ class Share extends UICorePlugin {
|
|
|
39531
39532
|
hide = false;
|
|
39532
39533
|
container = null;
|
|
39533
39534
|
get name() {
|
|
39534
|
-
return '
|
|
39535
|
+
return 'share';
|
|
39535
39536
|
}
|
|
39536
39537
|
get supportedVersion() {
|
|
39537
39538
|
return { min: CLAPPR_VERSION };
|
|
@@ -41174,6 +41175,10 @@ class Thumbnails extends UICorePlugin {
|
|
|
41174
41175
|
}
|
|
41175
41176
|
}
|
|
41176
41177
|
|
|
41178
|
+
/**
|
|
41179
|
+
* Events emitted by the VolumeFade plugin.
|
|
41180
|
+
* @beta
|
|
41181
|
+
*/
|
|
41177
41182
|
var VolumeFadeEvents;
|
|
41178
41183
|
(function (VolumeFadeEvents) {
|
|
41179
41184
|
VolumeFadeEvents["FADE"] = "core:volume:fade";
|
|
@@ -4,6 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
## ContextMenuPluginSettings interface
|
|
6
6
|
|
|
7
|
+
> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
|
8
|
+
>
|
|
9
|
+
|
|
10
|
+
The plugin adds a context menu to the player.
|
|
11
|
+
|
|
7
12
|
**Signature:**
|
|
8
13
|
|
|
9
14
|
```typescript
|
|
@@ -48,7 +53,7 @@ string
|
|
|
48
53
|
|
|
49
54
|
</td><td>
|
|
50
55
|
|
|
51
|
-
_(Optional)_
|
|
56
|
+
**_(BETA)_** _(Optional)_
|
|
52
57
|
|
|
53
58
|
|
|
54
59
|
</td></tr>
|
|
@@ -67,7 +72,7 @@ boolean
|
|
|
67
72
|
|
|
68
73
|
</td><td>
|
|
69
74
|
|
|
70
|
-
_(Optional)_
|
|
75
|
+
**_(BETA)_** _(Optional)_
|
|
71
76
|
|
|
72
77
|
|
|
73
78
|
</td></tr>
|
|
@@ -86,7 +91,7 @@ string
|
|
|
86
91
|
|
|
87
92
|
</td><td>
|
|
88
93
|
|
|
89
|
-
_(Optional)_
|
|
94
|
+
**_(BETA)_** _(Optional)_
|
|
90
95
|
|
|
91
96
|
|
|
92
97
|
</td></tr>
|
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
## ContextMenuPluginSettings.preventShowContextMenu property
|
|
6
6
|
|
|
7
|
+
> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
|
8
|
+
>
|
|
9
|
+
|
|
7
10
|
**Signature:**
|
|
8
11
|
|
|
9
12
|
```typescript
|
package/docs/api/player.md
CHANGED
|
@@ -195,7 +195,7 @@ Description
|
|
|
195
195
|
|
|
196
196
|
</td><td>
|
|
197
197
|
|
|
198
|
-
The plugin adds support for loading multiple streams and switching between them using the media control UI.
|
|
198
|
+
**_(BETA)_** The plugin adds support for loading multiple streams and switching between them using the media control UI.
|
|
199
199
|
|
|
200
200
|
|
|
201
201
|
</td></tr>
|
|
@@ -419,6 +419,8 @@ Custom events emitted by the plugin
|
|
|
419
419
|
|
|
420
420
|
</td><td>
|
|
421
421
|
|
|
422
|
+
**_(BETA)_** Events emitted by the VolumeFade plugin.
|
|
423
|
+
|
|
422
424
|
|
|
423
425
|
</td></tr>
|
|
424
426
|
</tbody></table>
|
|
@@ -480,6 +482,8 @@ Configuration options
|
|
|
480
482
|
|
|
481
483
|
</td><td>
|
|
482
484
|
|
|
485
|
+
**_(BETA)_** The plugin adds a context menu to the player.
|
|
486
|
+
|
|
483
487
|
|
|
484
488
|
</td></tr>
|
|
485
489
|
<tr><td>
|
|
@@ -891,7 +895,7 @@ Description
|
|
|
891
895
|
|
|
892
896
|
</td><td>
|
|
893
897
|
|
|
894
|
-
**_(BETA)_**
|
|
898
|
+
**_(BETA)_** [Zepto query result](https://zeptojs.com/#$())
|
|
895
899
|
|
|
896
900
|
|
|
897
901
|
</td></tr>
|
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
## MultiCamera.(constructor)
|
|
6
6
|
|
|
7
|
+
> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
|
8
|
+
>
|
|
9
|
+
|
|
7
10
|
Constructs a new instance of the `MultiCamera` class
|
|
8
11
|
|
|
9
12
|
**Signature:**
|
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
## MultiCamera class
|
|
6
6
|
|
|
7
|
+
> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
|
8
|
+
>
|
|
9
|
+
|
|
7
10
|
The plugin adds support for loading multiple streams and switching between them using the media control UI.
|
|
8
11
|
|
|
9
12
|
**Signature:**
|
|
@@ -41,7 +44,7 @@ Description
|
|
|
41
44
|
|
|
42
45
|
</td><td>
|
|
43
46
|
|
|
44
|
-
Constructs a new instance of the `MultiCamera` class
|
|
47
|
+
**_(BETA)_** Constructs a new instance of the `MultiCamera` class
|
|
45
48
|
|
|
46
49
|
|
|
47
50
|
</td></tr>
|
|
@@ -87,6 +90,8 @@ Description
|
|
|
87
90
|
|
|
88
91
|
</td><td>
|
|
89
92
|
|
|
93
|
+
**_(BETA)_**
|
|
94
|
+
|
|
90
95
|
|
|
91
96
|
</td></tr>
|
|
92
97
|
<tr><td>
|
|
@@ -106,6 +111,8 @@ Description
|
|
|
106
111
|
|
|
107
112
|
</td><td>
|
|
108
113
|
|
|
114
|
+
**_(BETA)_**
|
|
115
|
+
|
|
109
116
|
|
|
110
117
|
</td></tr>
|
|
111
118
|
<tr><td>
|
|
@@ -125,6 +132,8 @@ string
|
|
|
125
132
|
|
|
126
133
|
</td><td>
|
|
127
134
|
|
|
135
|
+
**_(BETA)_**
|
|
136
|
+
|
|
128
137
|
|
|
129
138
|
</td></tr>
|
|
130
139
|
<tr><td>
|
|
@@ -144,6 +153,8 @@ string
|
|
|
144
153
|
|
|
145
154
|
</td><td>
|
|
146
155
|
|
|
156
|
+
**_(BETA)_**
|
|
157
|
+
|
|
147
158
|
|
|
148
159
|
</td></tr>
|
|
149
160
|
<tr><td>
|
|
@@ -163,6 +174,8 @@ any
|
|
|
163
174
|
|
|
164
175
|
</td><td>
|
|
165
176
|
|
|
177
|
+
**_(BETA)_**
|
|
178
|
+
|
|
166
179
|
|
|
167
180
|
</td></tr>
|
|
168
181
|
<tr><td>
|
|
@@ -184,6 +197,8 @@ string
|
|
|
184
197
|
|
|
185
198
|
</td><td>
|
|
186
199
|
|
|
200
|
+
**_(BETA)_**
|
|
201
|
+
|
|
187
202
|
|
|
188
203
|
</td></tr>
|
|
189
204
|
</tbody></table>
|
|
@@ -216,6 +231,8 @@ Description
|
|
|
216
231
|
|
|
217
232
|
</td><td>
|
|
218
233
|
|
|
234
|
+
**_(BETA)_**
|
|
235
|
+
|
|
219
236
|
|
|
220
237
|
</td></tr>
|
|
221
238
|
<tr><td>
|
|
@@ -228,6 +245,8 @@ Description
|
|
|
228
245
|
|
|
229
246
|
</td><td>
|
|
230
247
|
|
|
248
|
+
**_(BETA)_**
|
|
249
|
+
|
|
231
250
|
|
|
232
251
|
</td></tr>
|
|
233
252
|
<tr><td>
|
|
@@ -240,6 +259,8 @@ Description
|
|
|
240
259
|
|
|
241
260
|
</td><td>
|
|
242
261
|
|
|
262
|
+
**_(BETA)_**
|
|
263
|
+
|
|
243
264
|
|
|
244
265
|
</td></tr>
|
|
245
266
|
<tr><td>
|
|
@@ -252,6 +273,8 @@ Description
|
|
|
252
273
|
|
|
253
274
|
</td><td>
|
|
254
275
|
|
|
276
|
+
**_(BETA)_**
|
|
277
|
+
|
|
255
278
|
|
|
256
279
|
</td></tr>
|
|
257
280
|
<tr><td>
|
|
@@ -264,6 +287,8 @@ Description
|
|
|
264
287
|
|
|
265
288
|
</td><td>
|
|
266
289
|
|
|
290
|
+
**_(BETA)_**
|
|
291
|
+
|
|
267
292
|
|
|
268
293
|
</td></tr>
|
|
269
294
|
<tr><td>
|
|
@@ -276,6 +301,8 @@ Description
|
|
|
276
301
|
|
|
277
302
|
</td><td>
|
|
278
303
|
|
|
304
|
+
**_(BETA)_**
|
|
305
|
+
|
|
279
306
|
|
|
280
307
|
</td></tr>
|
|
281
308
|
</tbody></table>
|
|
@@ -4,6 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
## VolumeFadeEvents enum
|
|
6
6
|
|
|
7
|
+
> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
|
8
|
+
>
|
|
9
|
+
|
|
10
|
+
Events emitted by the VolumeFade plugin.
|
|
11
|
+
|
|
7
12
|
**Signature:**
|
|
8
13
|
|
|
9
14
|
```typescript
|
|
@@ -40,6 +45,8 @@ FADE
|
|
|
40
45
|
|
|
41
46
|
</td><td>
|
|
42
47
|
|
|
48
|
+
**_(BETA)_**
|
|
49
|
+
|
|
43
50
|
|
|
44
51
|
</td></tr>
|
|
45
52
|
</tbody></table>
|
package/lib/Player.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ContainerSize,
|
|
1
|
+
import type { ContainerSize, PlayerPluginConstructor } from './types.js';
|
|
2
2
|
import { PlayerConfig, PlayerEvent } from './types.js';
|
|
3
3
|
import { PlaybackError, TimePosition } from './playback.types.js';
|
|
4
4
|
/**
|
|
@@ -186,12 +186,14 @@ export declare class Player {
|
|
|
186
186
|
* Player.registerPlugin(MyPlugin)
|
|
187
187
|
* ```
|
|
188
188
|
*/
|
|
189
|
-
static registerPlugin(plugin:
|
|
189
|
+
static registerPlugin(plugin: PlayerPluginConstructor): void;
|
|
190
|
+
private static getRegisteredPlugins;
|
|
191
|
+
private static corePlugins;
|
|
190
192
|
/**
|
|
191
193
|
* Unregisters a plugin registered earlier with {@link Player.registerPlugin}.
|
|
192
194
|
* @param plugin - a plugin class
|
|
193
195
|
*/
|
|
194
|
-
static unregisterPlugin(plugin:
|
|
196
|
+
static unregisterPlugin(plugin: PlayerPluginConstructor): void;
|
|
195
197
|
private setConfig;
|
|
196
198
|
private initPlayer;
|
|
197
199
|
private tuneIn;
|
package/lib/Player.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Player.d.ts","sourceRoot":"","sources":["../src/Player.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"Player.d.ts","sourceRoot":"","sources":["../src/Player.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EACV,aAAa,EAEb,uBAAuB,EACxB,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAGtD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAEjE;;GAEG;AACH,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,WAAW,IACjD,CAAC,SAAS,WAAW,CAAC,IAAI,GACtB,CAAC,MAAM,CAAC,GACR,CAAC,SAAS,WAAW,CAAC,YAAY,GAClC,CAAC,MAAM,CAAC,GACR,CAAC,SAAS,WAAW,CAAC,UAAU,GAChC,CAAC,YAAY,CAAC,GACd,CAAC,SAAS,WAAW,CAAC,MAAM,GAC5B,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,GACnC,CAAC,SAAS,WAAW,CAAC,UAAU,GAChC,CAAC,OAAO,CAAC,GACT,CAAC,SAAS,WAAW,CAAC,KAAK,GAC3B,CAAC,aAAa,CAAC,GACf,EAAE,CAAA;AAER;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,WAAW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,CAAC,IAAI,EAAE,MAAM;IAIjB;;;OAGG;IACH,SAAS,IAAI,MAAM;IAMnB;;;OAGG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM;IAMxB;;OAEG;IACH,IAAI;IAIJ;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,uBAAuB;IAgBrD,OAAO,CAAC,MAAM,CAAC,oBAAoB;IAUnC,OAAO,CAAC,MAAM,CAAC,WAAW,CAAgC;IAE1D;;;OAGG;IACH,MAAM,CAAC,gBAAgB,CAAC,MAAM,EAAE,uBAAuB;IAYvD,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,UAAU;YAcJ,MAAM;IAkBpB,OAAO,CAAC,eAAe;IASvB,OAAO,CAAC,gBAAgB;IAYxB,OAAO,CAAC,MAAM,CAgCb;IAED,OAAO,CAAC,gBAAgB;IAyCxB,OAAO,CAAC,kBAAkB;IAI1B,OAAO,CAAC,qBAAqB;IAQ7B,OAAO,CAAC,2BAA2B;IAsBnC,OAAO,CAAC,iBAAiB;CA6C1B"}
|
package/lib/Player.js
CHANGED
|
@@ -3,7 +3,7 @@ import { reportError, trace } from '@gcorevideo/utils';
|
|
|
3
3
|
import assert from 'assert';
|
|
4
4
|
import EventLite from 'event-lite';
|
|
5
5
|
import { PlayerEvent } from './types.js';
|
|
6
|
-
import { buildMediaSourcesList, wrapSource
|
|
6
|
+
import { buildMediaSourcesList, wrapSource } from './utils/mediaSources.js';
|
|
7
7
|
import { registerPlaybacks } from './playback/index.js';
|
|
8
8
|
const T = 'GPlayer';
|
|
9
9
|
const DEFAULT_OPTIONS = {
|
|
@@ -99,7 +99,7 @@ export class Player {
|
|
|
99
99
|
Log.setLevel(0);
|
|
100
100
|
}
|
|
101
101
|
const coreOpts = this.buildCoreOptions(playerElement);
|
|
102
|
-
const { core, container } =
|
|
102
|
+
const { core, container } = Player.getRegisteredPlugins();
|
|
103
103
|
trace(`${T} init`, {
|
|
104
104
|
registeredPlaybacks: Loader.registeredPlaybacks.map((p) => p.name),
|
|
105
105
|
});
|
|
@@ -261,13 +261,35 @@ export class Player {
|
|
|
261
261
|
* ```
|
|
262
262
|
*/
|
|
263
263
|
static registerPlugin(plugin) {
|
|
264
|
+
assert.ok(plugin.type === 'core' || plugin.type === 'container', 'Invalid plugin type');
|
|
265
|
+
if (plugin.type === 'core') {
|
|
266
|
+
if (plugin.prototype.name === 'media_control') {
|
|
267
|
+
Player.corePlugins.unshift(plugin);
|
|
268
|
+
}
|
|
269
|
+
else {
|
|
270
|
+
Player.corePlugins.push(plugin);
|
|
271
|
+
}
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
264
274
|
Loader.registerPlugin(plugin);
|
|
265
275
|
}
|
|
276
|
+
static getRegisteredPlugins() {
|
|
277
|
+
for (const plugin of Player.corePlugins) {
|
|
278
|
+
Loader.registerPlugin(plugin);
|
|
279
|
+
}
|
|
280
|
+
return Loader.registeredPlugins;
|
|
281
|
+
}
|
|
282
|
+
static corePlugins = [];
|
|
266
283
|
/**
|
|
267
284
|
* Unregisters a plugin registered earlier with {@link Player.registerPlugin}.
|
|
268
285
|
* @param plugin - a plugin class
|
|
269
286
|
*/
|
|
270
287
|
static unregisterPlugin(plugin) {
|
|
288
|
+
assert.ok(plugin.type === 'core' || plugin.type === 'container', 'Invalid plugin type');
|
|
289
|
+
if (plugin.type === 'core') {
|
|
290
|
+
Player.corePlugins = Player.corePlugins.filter((p) => p !== plugin);
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
271
293
|
Loader.unregisterPlugin(plugin);
|
|
272
294
|
}
|
|
273
295
|
setConfig(config) {
|
|
@@ -408,8 +430,10 @@ export class Player {
|
|
|
408
430
|
}, null);
|
|
409
431
|
}
|
|
410
432
|
bindCoreListeners() {
|
|
411
|
-
|
|
412
|
-
|
|
433
|
+
// TODO create an class inherited from PlayerClappr
|
|
434
|
+
assert.ok(this.player, 'Player is not initialized');
|
|
435
|
+
const core = this.player.core;
|
|
436
|
+
core.on(ClapprEvents.CORE_SCREEN_ORIENTATION_CHANGED, ({ orientation }) => {
|
|
413
437
|
trace(`${T} on CORE_SCREEN_ORIENTATION_CHANGED`, {
|
|
414
438
|
orientation,
|
|
415
439
|
rootNode: {
|
|
@@ -424,14 +448,14 @@ export class Player {
|
|
|
424
448
|
});
|
|
425
449
|
}
|
|
426
450
|
}, null);
|
|
427
|
-
core
|
|
451
|
+
core.on(ClapprEvents.CORE_RESIZE, ({ width, height }) => {
|
|
428
452
|
trace(`${T} on CORE_RESIZE`, {
|
|
429
453
|
width,
|
|
430
454
|
height,
|
|
431
455
|
});
|
|
432
456
|
this.safeTriggerEvent(PlayerEvent.Resize, { width, height });
|
|
433
457
|
}, null);
|
|
434
|
-
core
|
|
458
|
+
core.on(ClapprEvents.CORE_FULLSCREEN, (isFullscreen) => {
|
|
435
459
|
trace(`${T} CORE_FULLSCREEN`, {
|
|
436
460
|
isFullscreen,
|
|
437
461
|
});
|
package/lib/internal.types.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { CorePlugin,
|
|
2
|
-
import { ContainerSize, PlaybackType, PlayerDebugTag, PlayerMediaSource } from
|
|
3
|
-
import { PlaybackError } from
|
|
1
|
+
import type { CorePlugin, Playback as ClapprPlayback } from '@clappr/core';
|
|
2
|
+
import { ContainerSize, PlaybackType, PlayerDebugTag, PlayerMediaSource, type CorePluginConstructor, type ContainerPluginConstructor } from './types';
|
|
3
|
+
import { PlaybackError } from './playback.types.js';
|
|
4
4
|
type ExternalTrack = {
|
|
5
|
-
kind?:
|
|
5
|
+
kind?: 'subtitles' | 'captions';
|
|
6
6
|
src: string;
|
|
7
7
|
label: string;
|
|
8
8
|
lang: string;
|
|
@@ -65,8 +65,8 @@ export type PlaybackPluginFactory = typeof ClapprPlayback;
|
|
|
65
65
|
* @internal
|
|
66
66
|
*/
|
|
67
67
|
export type CorePluginOptions = {
|
|
68
|
-
core?:
|
|
69
|
-
container?:
|
|
68
|
+
core?: CorePluginConstructor[];
|
|
69
|
+
container?: ContainerPluginConstructor[];
|
|
70
70
|
playback?: PlaybackPluginFactory[];
|
|
71
71
|
loadExternalPluginsFirst?: boolean;
|
|
72
72
|
loadExternalPlaybacksFirst?: boolean;
|
|
@@ -100,7 +100,7 @@ export type CoreOptions = {
|
|
|
100
100
|
mimeType?: string;
|
|
101
101
|
mute?: boolean;
|
|
102
102
|
persistConfig?: boolean;
|
|
103
|
-
preload?:
|
|
103
|
+
preload?: 'auto' | 'metadata' | 'none';
|
|
104
104
|
parentId?: string;
|
|
105
105
|
parent?: HTMLElement;
|
|
106
106
|
playback?: CorePlaybackConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.types.d.ts","sourceRoot":"","sources":["../src/internal.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,
|
|
1
|
+
{"version":3,"file":"internal.types.d.ts","sourceRoot":"","sources":["../src/internal.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EAEV,QAAQ,IAAI,cAAc,EAC3B,MAAM,cAAc,CAAA;AAErB,OAAO,EACL,aAAa,EACb,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,KAAK,qBAAqB,EAC1B,KAAK,0BAA0B,EAChC,MAAM,SAAS,CAAA;AAChB,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAEnD,KAAK,aAAa,GAAG;IACnB,IAAI,CAAC,EAAE,WAAW,GAAG,UAAU,CAAA;IAC/B,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED,KAAK,kBAAkB,GAAG;IAExB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAED;;;GAGG;AACH,KAAK,WAAW,GAAG;IACjB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,UAAU,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C,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,YAAY,CAAC,EAAE,kBAAkB,CAAA;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,OAAO,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,MAAM,CAAA;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,QAAQ,CAAC,EAAE,kBAAkB,CAAA;IAC7B,2BAA2B,CAAC,EAAE,MAAM,CAAA;IACpC,YAAY,CAAC,EAAE,YAAY,CAAA;IAC3B,OAAO,CAAC,EAAE,iBAAiB,GAAG,UAAU,EAAE,CAAA;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,iBAAiB,EAAE,CAAA;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { Container, UIContainerPlugin } from '@clappr/core';
|
|
2
2
|
import '../../../assets/context-menu/context_menu.scss';
|
|
3
|
+
/**
|
|
4
|
+
* The plugin adds a context menu to the player.
|
|
5
|
+
* @beta
|
|
6
|
+
*/
|
|
3
7
|
export interface ContextMenuPluginSettings {
|
|
4
8
|
label?: string;
|
|
5
9
|
url?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextMenu.d.ts","sourceRoot":"","sources":["../../../src/plugins/context-menu/ContextMenu.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,SAAS,EACT,iBAAiB,EAClB,MAAM,cAAc,CAAA;AAIrB,OAA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