@flowplayer/player 3.14.1 → 3.15.0-rc.10

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.
Files changed (81) hide show
  1. package/core/events.d.ts +575 -68
  2. package/core/events.js +286 -34
  3. package/core.js +1 -1
  4. package/default.js +1 -1
  5. package/embed.js +2 -2
  6. package/flowplayer.css +1 -1
  7. package/index.d.ts +1480 -91
  8. package/package.json +1 -1
  9. package/plugins/ads.d.ts +3744 -112
  10. package/plugins/ads.js +1 -1
  11. package/plugins/airplay.d.ts +1440 -116
  12. package/plugins/airplay.js +1 -1
  13. package/plugins/analytics.d.ts +1409 -82
  14. package/plugins/analytics.js +1 -1
  15. package/plugins/asel.d.ts +1409 -82
  16. package/plugins/asel.js +1 -1
  17. package/plugins/audio.d.ts +1409 -82
  18. package/plugins/audio.js +1 -1
  19. package/plugins/chapters.d.ts +1409 -82
  20. package/plugins/chapters.js +1 -1
  21. package/plugins/chromecast.d.ts +1464 -80
  22. package/plugins/chromecast.js +1 -1
  23. package/plugins/comscore.d.ts +1409 -82
  24. package/plugins/consent.d.ts +1409 -82
  25. package/plugins/consent.js +1 -1
  26. package/plugins/context-menu.d.ts +1443 -116
  27. package/plugins/cuepoints.d.ts +1443 -116
  28. package/plugins/cuepoints.js +1 -1
  29. package/plugins/dash.d.ts +1445 -115
  30. package/plugins/dash.js +1 -1
  31. package/plugins/drm.d.ts +1409 -82
  32. package/plugins/drm.js +1 -1
  33. package/plugins/endscreen.d.ts +1442 -115
  34. package/plugins/endscreen.js +1 -1
  35. package/plugins/fas.d.ts +1409 -82
  36. package/plugins/float-on-scroll.d.ts +1443 -116
  37. package/plugins/float-on-scroll.js +1 -1
  38. package/plugins/ga4.d.ts +1409 -82
  39. package/plugins/gemius.d.ts +1439 -112
  40. package/plugins/google-analytics.d.ts +1409 -82
  41. package/plugins/health.d.ts +1435 -107
  42. package/plugins/health.js +1 -1
  43. package/plugins/hls.d.ts +1431 -104
  44. package/plugins/hls.js +1 -1
  45. package/plugins/id3.d.ts +1409 -82
  46. package/plugins/id3.js +1 -1
  47. package/plugins/iframe.d.ts +1440 -116
  48. package/plugins/iframe.js +1 -1
  49. package/plugins/keyboard.d.ts +1409 -82
  50. package/plugins/media-session.d.ts +1409 -82
  51. package/plugins/message.d.ts +1409 -82
  52. package/plugins/message.js +1 -1
  53. package/plugins/ovp.d.ts +1435 -110
  54. package/plugins/ovp.js +1 -1
  55. package/plugins/playlist.d.ts +1409 -82
  56. package/plugins/playlist.js +1 -1
  57. package/plugins/preview.d.ts +1409 -82
  58. package/plugins/preview.js +1 -1
  59. package/plugins/qsel.d.ts +1409 -82
  60. package/plugins/qsel.js +1 -1
  61. package/plugins/qul.d.ts +1441 -114
  62. package/plugins/qul.js +1 -1
  63. package/plugins/rts.d.ts +1409 -82
  64. package/plugins/rts.js +1 -1
  65. package/plugins/share.d.ts +1409 -82
  66. package/plugins/share.js +1 -1
  67. package/plugins/speed.d.ts +1434 -107
  68. package/plugins/speed.js +1 -1
  69. package/plugins/ssai.d.ts +1412 -82
  70. package/plugins/ssai.js +1 -1
  71. package/plugins/subtitles.d.ts +1426 -102
  72. package/plugins/thumbnails.d.ts +1434 -107
  73. package/plugins/thumbnails.js +1 -1
  74. package/plugins/tizen.d.ts +1409 -82
  75. package/plugins/tizen.js +1 -1
  76. package/plugins/vtsel.d.ts +1409 -82
  77. package/plugins/vtsel.js +1 -1
  78. package/plugins/webos.d.ts +1409 -82
  79. package/plugins/webos.js +1 -1
  80. package/util/loader.d.ts +1436 -101
  81. package/util/loader.js +13 -2
package/plugins/dash.d.ts CHANGED
@@ -1,3 +1,6 @@
1
+ /// <reference types="node" />
2
+
3
+ import type { BitrateInfo } from 'dashjs';
1
4
  import type * as DashJS from 'dashjs';
2
5
  import type { MediaKeyFunc } from 'hls.js';
3
6
  import type { MediaPlayerClass } from 'dashjs';
@@ -10,6 +13,8 @@ declare namespace allEvents {
10
13
  }
11
14
  }
12
15
 
16
+ /* Excluded from this release type: AnyLoader */
17
+
13
18
  declare type ArrayToIntersection<T extends Array<unknown>> = T extends [
14
19
  infer Current,
15
20
  ...infer Remaining
@@ -21,6 +26,22 @@ infer Current,
21
26
  */
22
27
  declare const ATTACHED = "dash:attached";
23
28
 
29
+ /**
30
+ * Each loader must
31
+ */
32
+ declare type _AttachedEventCheck = {
33
+ on(event: `${string}:attached`, handler: (e: FPEvent<unknown>) => void): Player;
34
+ };
35
+
36
+ /* Excluded from this release type: AUDIO_ONLY_SOURCE */
37
+
38
+ /* Excluded from this release type: AudioOnlySourceEventDetail */
39
+
40
+ declare const AUTOPLAY = "is-autoplay";
41
+
42
+ /**
43
+ * @public
44
+ */
24
45
  declare type Autoplay = BitOpts | boolean;
25
46
 
26
47
  declare enum AutoplayOpts {
@@ -29,19 +50,60 @@ declare enum AutoplayOpts {
29
50
  AUDIO_REQUIRED = 2
30
51
  }
31
52
 
32
- declare type BitOpts = number;
53
+ /* Excluded from this release type: BEFORE_PAUSE */
54
+
55
+ /* Excluded from this release type: BEFORE_PLAY */
56
+
57
+ /**
58
+ * @public
59
+ */
60
+ declare type BeforePauseEventDetail = {
61
+ forced: boolean;
62
+ };
33
63
 
34
- declare type Component = {
35
- onrender?: (config: Config, root: PlayerRoot, player: Player) => void;
36
- onremove?: (config: Config, root: PlayerRoot, player: Player) => void;
64
+ /**
65
+ * @public
66
+ */
67
+ declare type BeforePlayEventDetail = {
68
+ forced: boolean;
37
69
  };
38
70
 
39
- declare interface Components {
40
- render(key: string, args: any[]): void;
41
- remove(key: string, args: any[]): void;
42
- put(key: string, args: Component): void;
43
- }
71
+ /**
72
+ * @public
73
+ */
74
+ declare type BitOpts = number;
75
+
76
+ /**
77
+ * @public
78
+ */
79
+ declare const /**
80
+ @public
81
+ * when a new player is inserted into the HTML
82
+ */ /**
83
+ * @public
84
+ */
85
+ CAN_PLAY = "canplay";
86
+
87
+ /**
88
+ * @public
89
+ */
90
+ declare const /**
91
+ @public
92
+ * when a new player is inserted into the HTML
93
+ */ /**
94
+ * @public
95
+ */
96
+ CLICK = "click";
97
+
98
+ /* Excluded from this release type: Component */
44
99
 
100
+ /* Excluded from this release type: Components */
101
+
102
+ /* Excluded from this release type: CONFIG */
103
+
104
+ /**
105
+ * @public
106
+ */
45
107
  declare interface Config {
46
108
  src?: UnsafeSource;
47
109
  preload?: "none" | "metadata" | "auto";
@@ -51,7 +113,7 @@ declare interface Config {
51
113
  autopause?: boolean;
52
114
  rewind?: boolean;
53
115
  loop?: boolean;
54
- seamless?: boolean;
116
+ /* Excluded from this release type: seamless */
55
117
  retry?: boolean;
56
118
  autoplay?: Autoplay;
57
119
  start_quality?: BitOpts;
@@ -59,10 +121,7 @@ declare interface Config {
59
121
  poster?: string;
60
122
  disabled?: boolean;
61
123
  muted?: boolean;
62
- /**
63
- * is src handled by one of plugins loaders
64
- */
65
- is_native?: boolean;
124
+ /* Excluded from this release type: is_native */
66
125
  /**
67
126
  * bitflags for UI options
68
127
  */
@@ -71,10 +130,7 @@ declare interface Config {
71
130
  * your user access token
72
131
  */
73
132
  token?: string;
74
- /**
75
- * manually configured duration for pre-rendering usually
76
- */
77
- duration?: number;
133
+ /* Excluded from this release type: duration */
78
134
  /**
79
135
  * can the content be seeked to any position
80
136
  */
@@ -92,9 +148,91 @@ declare interface Config {
92
148
  seconds_to_dvr?: number;
93
149
  }
94
150
 
151
+ /* Excluded from this release type: ConfigEventDetail */
152
+
153
+ /**
154
+ * @public
155
+ */
95
156
  declare type ConfigWith<T> = Config & T;
96
157
 
97
- /* Excluded from this release type: Dash */
158
+ /* Excluded from this release type: CONTENT_REAL_LOAD_START */
159
+
160
+ /**
161
+ * @public
162
+ */
163
+ declare const /**
164
+ @public
165
+ * when a new player is inserted into the HTML
166
+ */ /**
167
+ * @public
168
+ */
169
+ CONTEXT_MENU = "contextmenu";
170
+
171
+ /**
172
+ * @public
173
+ */
174
+ declare type ContextMenuEventDetail = null;
175
+
176
+ /**
177
+ * @public
178
+ * when a cuepoint becomes inactive
179
+ */
180
+ declare const /**
181
+ @public
182
+ * when a new player is inserted into the HTML
183
+ */ /**
184
+ * @public
185
+ * when a cuepoint becomes inactive
186
+ */
187
+ CUEPOINT_END = "cuepointend";
188
+
189
+ /**
190
+ * @public
191
+ * when a cuepoint is active
192
+ */
193
+ declare const /**
194
+ @public
195
+ * when a new player is inserted into the HTML
196
+ */ /**
197
+ * @public
198
+ * when a cuepoint is active
199
+ */
200
+ CUEPOINT_START = "cuepointstart";
201
+
202
+ /**
203
+ * @public
204
+ */
205
+ declare type CuePointEndEventDetail = null;
206
+
207
+ /**
208
+ * @public
209
+ * cuepoints parsing is asynchronous
210
+ * you cannot rely on them existing until
211
+ * this event is emitted
212
+ */
213
+ declare const /**
214
+ @public
215
+ * when a new player is inserted into the HTML
216
+ */ /**
217
+ * @public
218
+ * cuepoints parsing is asynchronous
219
+ * you cannot rely on them existing until
220
+ * this event is emitted
221
+ */
222
+ CUEPOINTS = "cuepoints";
223
+
224
+ /**
225
+ * @public
226
+ */
227
+ declare type CuePointStartEventDetail = null;
228
+
229
+ /**
230
+ * @public
231
+ * This plugin implements an MPEG-DASH loader plugin which is capable of playing .mpd source files.
232
+ * See {@link https://developer.wowza.com/docs/wowza-flowplayer/plugins/mpeg-dash | Official documentation}
233
+ */
234
+ declare const Dash: PluginCtor<DashConfig, DashPlayer> & DashAPI;
235
+ export default Dash;
98
236
 
99
237
  /**
100
238
  * @public
@@ -118,12 +256,12 @@ export declare type DashAttachedEvent = FPEvent<{
118
256
  * @public
119
257
  * This type is used to extend the Player configuration with the Dash plugin configuration.
120
258
  */
121
- export declare type DashConfig = {
259
+ export declare type DashConfig = ConfigWith<{
122
260
  /**
123
261
  * The dash plugin does not have any configuration options.
124
262
  */
125
263
  dash?: never;
126
- };
264
+ }>;
127
265
 
128
266
  /* Excluded from this release type: _DashConfig */
129
267
 
@@ -133,27 +271,59 @@ export declare type DashConfig = {
133
271
  */
134
272
  export declare type DashEvents = typeof allEvents;
135
273
 
274
+ /* Excluded from this release type: DashInstance */
136
275
  export { DashJS }
137
276
 
138
- /* Excluded from this release type: DashPlayer */
139
-
140
277
  /**
141
278
  * @public
142
279
  * This type is used to extend the Player API with the Dash API.
143
280
  */
144
- export declare type DashPlayerAPI = {
281
+ export declare type DashPlayer = PlayerWith<{
282
+ /* Excluded from this release type: dash */
283
+ /**
284
+ * @public
285
+ */
145
286
  on(event: DashEvents["ATTACHED"], handler: (e: DashAttachedEvent) => void): Player;
146
- };
287
+ }>;
147
288
 
148
289
  /* Excluded from this release type: DashSettings */
149
290
 
150
- declare const _default: PluginCtor<DashConfig, DashPlayerAPI> & DashAPI;
151
- export default _default;
291
+ /**
292
+ * @public
293
+ */
294
+ declare const /**
295
+ @public
296
+ * when a new player is inserted into the HTML
297
+ */ /**
298
+ * @public
299
+ */
300
+ DATA = "loadeddata";
301
+
302
+ /**
303
+ * @public
304
+ */
305
+ declare const /**
306
+ @public
307
+ * when a new player is inserted into the HTML
308
+ */ /**
309
+ * @public
310
+ */
311
+ DBL_CLICK = "dblclick";
312
+
313
+ declare const DESTROYED = "is-destroyed";
314
+
315
+ /* Excluded from this release type: DeviceId */
152
316
 
153
- declare type DeviceId = string;
317
+ declare const DISABLED = "is-disabled";
154
318
 
319
+ /**
320
+ * @public
321
+ */
155
322
  declare type DRM_KEYSYSTEM = "com.widevine.alpha" | "com.microsoft.playready" | "org.w3.clearkey" | "com.apple.fps.1_0";
156
323
 
324
+ /**
325
+ * @public
326
+ */
157
327
  declare type DRMConfiguration = {
158
328
  license_server: string;
159
329
  http_headers?: Record<string, string>;
@@ -163,10 +333,16 @@ declare type DRMConfiguration = {
163
333
  query_params?: Record<string, string>;
164
334
  };
165
335
 
336
+ /**
337
+ * @public
338
+ */
166
339
  declare type DRMSourceConfiguration = {
167
340
  [keysystem in DRM_KEYSYSTEM]?: DRMConfiguration;
168
341
  };
169
342
 
343
+ /**
344
+ * @public
345
+ */
170
346
  declare type DRMVendorImplementation = {
171
347
  fairplay_fetch_certificate: (url: string, cb: (certificate_data: Uint8Array) => void) => void;
172
348
  fairplay_request_license: (url: string, params: {
@@ -175,41 +351,229 @@ declare type DRMVendorImplementation = {
175
351
  }, cb: (license_data: Uint8Array) => void) => void;
176
352
  };
177
353
 
354
+ /**
355
+ * @public
356
+ */
357
+ declare const /**
358
+ @public
359
+ * when a new player is inserted into the HTML
360
+ */ /**
361
+ * @public
362
+ */
363
+ DURATION_CHANGE = "durationchange";
364
+
365
+ /**
366
+ * @public
367
+ * when the player has started playing dvr content
368
+ */
369
+ declare const /**
370
+ @public
371
+ * when a new player is inserted into the HTML
372
+ */ /**
373
+ * @public
374
+ * when the player has started playing dvr content
375
+ */
376
+ DVR = "dvr";
377
+
378
+ /**
379
+ * @public
380
+ */
381
+ declare type DvrEventDetail = number;
382
+
383
+ declare const ENDED = "is-ended";
384
+
385
+ /**
386
+ * @public
387
+ */
388
+ declare const /**
389
+ @public
390
+ * when a new player is inserted into the HTML
391
+ */ /**
392
+ * @public
393
+ */
394
+ ENDED_2 = "ended";
395
+
396
+ declare type EnsureOnAttached<P extends Function, T extends Player> = ExtractPureAPI<T> extends _AttachedEventCheck ? P : "Loaders must implement on('<pluginname>:attached') event";
397
+
398
+ /**
399
+ * @public
400
+ */
401
+ declare const /**
402
+ @public
403
+ * when a new player is inserted into the HTML
404
+ */ /**
405
+ * @public
406
+ */
407
+ ERROR = "error";
408
+
409
+ declare const ERRORED = "is-error";
410
+
411
+ /**
412
+ * @public
413
+ */
414
+ declare type ErrorEventDetail = {
415
+ src?: string;
416
+ type?: string;
417
+ code?: number | string;
418
+ };
419
+
420
+ /* Excluded from this release type: _ErrorEventDetail */
421
+
422
+ declare namespace events {
423
+ export {
424
+ MOUNT,
425
+ ERROR,
426
+ CONTEXT_MENU,
427
+ CLICK,
428
+ DBL_CLICK,
429
+ KEYUP,
430
+ KEYDOWN,
431
+ LOAD,
432
+ MOUSE_ENTER,
433
+ MOUSE_LEAVE,
434
+ MOUSE_UP,
435
+ MOUSE_DOWN,
436
+ MOUSE_MOVE,
437
+ TOUCH_START,
438
+ TOUCH_MOVE,
439
+ TOUCH_END,
440
+ TOUCH_CANCEL,
441
+ RESIZE,
442
+ SCROLL,
443
+ FULLSCREEN_ENTER,
444
+ FULLSCREEN_EXIT,
445
+ FULLSCREEN_CHANGE,
446
+ METADATA,
447
+ DATA,
448
+ PROGRESS,
449
+ TIME_UPDATE,
450
+ LOAD_START,
451
+ VOLUME_CHANGE,
452
+ PAUSE,
453
+ PLAYING_2 as PLAYING,
454
+ PLAY,
455
+ WAITING_2 as WAITING,
456
+ CAN_PLAY,
457
+ ENDED_2 as ENDED,
458
+ SEEKED,
459
+ SEEKING_2 as SEEKING,
460
+ DURATION_CHANGE,
461
+ CUEPOINTS,
462
+ CUEPOINT_START,
463
+ CUEPOINT_END,
464
+ VIEW_ENTER,
465
+ VIEW_LEAVE,
466
+ SOURCE,
467
+ REAP,
468
+ QUALITIES,
469
+ VIDEO_TRACKS,
470
+ SET_QUALITY,
471
+ VIDEO_TRACK_SELECT,
472
+ RECOMMENDATIONS_READY,
473
+ LANDSCAPE,
474
+ PORTRAIT,
475
+ DVR,
476
+ LIVE_2 as LIVE
477
+ }
478
+ }
479
+
480
+ declare type ExtractPureAPI<T> = T extends PlayerWith<infer PureAPI> ? PureAPI : never;
481
+
482
+ /**
483
+ * @public
484
+ */
178
485
  declare type FlowplayerCustomElementRegistry = Map<string, string>;
179
486
 
487
+ /**
488
+ * @public
489
+ */
490
+ declare type FlowplayerStates = typeof states;
491
+
492
+ /**
493
+ * @public
494
+ */
180
495
  declare interface FlowplayerUMD extends FlowplayerUMDBase {
496
+ /**
497
+ * Configure flowplayer and display it in the UI
498
+ * @param selector - query selector of the HTML element where player will render
499
+ * @param config - configuration of flowplayer
500
+ */
181
501
  (selector: string, config?: Config): Player;
502
+ /**
503
+ * Configure flowplayer and display it in the UI
504
+ * @param element - HTML element where player will render
505
+ * @param config - configuration of flowplayer
506
+ */
182
507
  (element: HTMLElement, config?: Config): Player;
508
+ /**
509
+ * Configure flowplayer and display it in the UI
510
+ * @param selector - query selector of the HTML element where player will render
511
+ * @param config - configuration of flowplayer
512
+ */
183
513
  <T>(selector: string, config?: ConfigWith<T>): Player;
514
+ /**
515
+ * Configure flowplayer and display it in the UI
516
+ * @param element - HTML element where player will render
517
+ * @param config - configuration of flowplayer
518
+ */
184
519
  <T>(element: HTMLElement, config?: ConfigWith<T>): Player;
520
+ /**
521
+ * Register plugins in flowplayer
522
+ * @returns flowplayer instance with registered plugins
523
+ */
185
524
  <PluginCtors extends PluginCtor[]>(...plugins: PluginCtors): FlowplayerUMDWithPlugins<ConfigWith<MergeConfigs<PluginCtors>>, PlayerWith<MergePlayerAPIExtensions<PluginCtors>>>;
186
525
  }
187
526
 
188
527
  declare interface FlowplayerUMDBase {
528
+ /**
529
+ * All player instances on the page
530
+ */
189
531
  instances: Player[];
190
- extensions: PluginCtor<KeyValue, any>[];
191
- events: Record<string, string>;
192
- ads?: {
193
- events: Record<string, string>;
194
- };
195
- states: Record<string, string>;
532
+ /**
533
+ * Flowplayer core events
534
+ */
535
+ events: typeof events;
536
+ /**
537
+ * Flowplayer ui states map
538
+ */
539
+ states: FlowplayerStates;
196
540
  quality: typeof QualityOpts;
541
+ autoplay: typeof AutoplayOpts;
197
542
  commit: string;
198
543
  version: string;
544
+ /**
545
+ * Flowplayer's custom element registry
546
+ */
199
547
  customElements: FlowplayerCustomElementRegistry;
200
- defaultElements: Record<string, string>;
201
- components: Components;
202
- support: any;
203
- autoplay: typeof AutoplayOpts;
204
- jwt: any;
205
- loaders: any;
548
+ /* Excluded from this release type: extensions */
549
+ /* Excluded from this release type: defaultElements */
550
+ /* Excluded from this release type: components */
551
+ /* Excluded from this release type: support */
552
+ /* Excluded from this release type: jwt */
553
+ /* Excluded from this release type: loaders */
206
554
  }
207
555
 
208
- declare interface FlowplayerUMDWithPlugins<ConfigWithPlugins extends Config = Config, PluginPlayerAPIExtension extends Player = Player> extends FlowplayerUMDBase {
209
- (selector: string, config?: ConfigWithPlugins): PluginPlayerAPIExtension;
210
- (element: HTMLElement, config?: ConfigWithPlugins): PluginPlayerAPIExtension;
556
+ /**
557
+ * @public
558
+ */
559
+ declare interface FlowplayerUMDWithPlugins<ConfigWithPlugins extends Config = Config, PluginPlayer extends Player = Player> extends FlowplayerUMDBase {
560
+ /**
561
+ * Configure flowplayer, it's attached plugins and display flowplayer it in the UI
562
+ * @param selector - query selector of the HTML element where player will render
563
+ * @param config - Configuration of the flowplayer and the attached plugins
564
+ */
565
+ (selector: string, config?: ConfigWithPlugins): PluginPlayer;
566
+ /**
567
+ * Configure flowplayer, it's attached plugins and display flowplayer it in the UI
568
+ * @param element - HTML element where player will render
569
+ * @param config - Configuration of the flowplayer and the attached plugins
570
+ */
571
+ (element: HTMLElement, config?: ConfigWithPlugins): PluginPlayer;
211
572
  }
212
573
 
574
+ /**
575
+ * @public
576
+ */
213
577
  declare interface FPEvent<T> extends CustomEvent<T> {
214
578
  /**
215
579
  * @deprecated
@@ -219,118 +583,1084 @@ declare interface FPEvent<T> extends CustomEvent<T> {
219
583
  data?: T;
220
584
  }
221
585
 
222
- declare type JSONPlayer = any;
586
+ declare const FULLSCREEN = "is-fullscreen";
223
587
 
224
- declare type KeyValue = Record<string, any>;
588
+ /**
589
+ * @public
590
+ */
591
+ declare const /**
592
+ @public
593
+ * when a new player is inserted into the HTML
594
+ */ /**
595
+ * @public
596
+ */
597
+ FULLSCREEN_CHANGE = "fullscreenchange";
225
598
 
226
- declare interface Loader<PluginOwnConfig extends KeyValue = KeyValue, PluginPlayerAPIExtension extends KeyValue = KeyValue> extends Plugin_2<PluginOwnConfig, PluginPlayerAPIExtension> {
227
- onload(config: ConfigWith<PluginOwnConfig>, root: PlayerRoot, video: PlayerWith<PluginPlayerAPIExtension>, src?: SourceObj): void;
228
- wants<S = SourceObj>(srcString: SourceStr, srcObj: S, config: ConfigWith<PluginOwnConfig>): boolean;
229
- wants<S = KeyValue>(srcString: SourceStr, srcObj: SourceWith<S>, config: ConfigWith<PluginOwnConfig>): boolean;
230
- }
599
+ /**
600
+ * @public
601
+ */
602
+ declare const /**
603
+ @public
604
+ * when a new player is inserted into the HTML
605
+ */ /**
606
+ * @public
607
+ */
608
+ FULLSCREEN_ENTER = "fullscreenenter";
231
609
 
232
- declare type MapToConfigs<Arr extends PluginCtor[]> = {
233
- [PluginType in keyof Arr]: Arr[PluginType] extends PluginCtor<infer ConfigType> ? ConfigType : never;
234
- };
610
+ /**
611
+ * @public
612
+ */
613
+ declare const /**
614
+ @public
615
+ * when a new player is inserted into the HTML
616
+ */ /**
617
+ * @public
618
+ */
619
+ FULLSCREEN_EXIT = "fullscreenexit";
235
620
 
236
- declare type MapToPlayerApiExtensions<Arr extends PluginCtor[]> = {
237
- [PluginType in keyof Arr]: Arr[PluginType] extends PluginCtor<infer _uConfigType, infer PlayerAPIExtension> ? PlayerAPIExtension : never;
238
- };
621
+ declare const GRABBING = "is-grabbing";
239
622
 
240
- declare type MergeConfigs<Arr extends PluginCtor[]> = ArrayToIntersection<MapToConfigs<Arr>>;
623
+ declare const HAS_POSTER = "has-poster";
241
624
 
242
- declare type MergePlayerAPIExtensions<Arr extends PluginCtor[]> = ArrayToIntersection<MapToPlayerApiExtensions<Arr>>;
625
+ declare const HOVERED = "is-hovered";
243
626
 
244
- declare interface Player extends HTMLVideoElement {
245
- renderPlugin: (pluginContainer: HTMLElement) => void;
246
- toggleDisable: (flag: boolean) => void;
247
- original_src: string;
248
- root: PlayerRoot;
249
- playerState: Record<string, boolean>;
250
- reaper: Map<string, any> | 0;
251
- hasState(state: PlayerState): boolean;
252
- transitionState(to: PlayerState, from: PlayerState, timer?: number): void;
253
- togglePlay(on?: boolean): Promise<void>;
254
- toggleFullScreen(on?: boolean, state_only?: boolean): void;
255
- toggleMute(on?: boolean): void;
256
- destroy(): void;
257
- render(): void;
258
- render(component: string, args: any[]): void;
259
- createComponents(...args: string[]): HTMLElement[];
260
- setOpts(config: Config): void;
261
- setSrc(sources: UnsafeSource): Player;
262
- on<T>(event: string | string[], handler: (e: FPEvent<T>) => void): Player;
263
- once<T>(event: string, handler: (e: FPEvent<T>) => void): Player;
264
- off<T>(event: string, handler: (e: FPEvent<T>) => void): Player;
265
- poll<T>(event: string, data?: T): FPEvent<T>;
266
- emit<T>(event: string, data?: T): Player;
267
- setAttrs(attrs: Config): Player;
268
- opt<T>(key: string, fallback?: T): T;
269
- enqueueSeek(offset: number): any;
270
- setState(state: string, flag: boolean): Player;
271
- toJSON(): JSONPlayer;
272
- i18n(k: string, fallback?: string): string;
273
- deviceId(): DeviceId;
274
- live_state: {
275
- dvr?: boolean;
276
- dvr_window?: number;
277
- };
278
- opts: Config;
279
- plugins: Array<Plugin_2 | Loader>;
280
- dvr_offset?: number;
281
- message?: {
282
- events: Record<string, string>;
283
- };
284
- disabled: boolean;
285
- started?: boolean;
286
- token: string;
287
- tracks?: VideoTrack[];
288
- _customElements: FlowplayerCustomElementRegistry;
289
- _storage: Storage;
290
- }
627
+ declare const IN_VIEWPORT = "is-in-viewport";
291
628
 
292
- declare type PlayerRoot = HTMLElement & {
293
- prevWidth?: number;
294
- };
629
+ /* Excluded from this release type: INTERSECTIONCHANGE */
295
630
 
296
- declare type PlayerState = string;
631
+ /* Excluded from this release type: IntersectionChangeEventDetail */
297
632
 
298
- declare type PlayerWith<T> = T & Player;
633
+ declare const IS_SOURCE_PROCESSING = "is-source-processing";
299
634
 
300
- declare interface Plugin_2<PluginOwnConfig extends KeyValue = KeyValue, PluginPlayerAPIExtension extends KeyValue = KeyValue> {
635
+ declare type JSONPlayer = any;
636
+
637
+ /**
638
+ * @public
639
+ */
640
+ declare const /**
641
+ @public
642
+ * when a new player is inserted into the HTML
643
+ */ /**
644
+ * @public
645
+ */
646
+ KEYDOWN = "keydown";
647
+
648
+ /**
649
+ * @public
650
+ */
651
+ declare const /**
652
+ @public
653
+ * when a new player is inserted into the HTML
654
+ */ /**
655
+ * @public
656
+ */
657
+ KEYUP = "keyup";
658
+
659
+ /**
660
+ * @public
661
+ */
662
+ declare type KeyValue = Record<string, any>;
663
+
664
+ /**
665
+ * @public
666
+ */
667
+ declare const /**
668
+ @public
669
+ * when a new player is inserted into the HTML
670
+ */ /**
671
+ * @public
672
+ */
673
+ LANDSCAPE = "landscape";
674
+
675
+ declare const LIVE = "is-live";
676
+
677
+ /**
678
+ * @public
679
+ * when src is a livestream
680
+ */
681
+ declare const /**
682
+ @public
683
+ * when a new player is inserted into the HTML
684
+ */ /**
685
+ * @public
686
+ * when src is a livestream
687
+ */
688
+ LIVE_2 = "live";
689
+
690
+ declare const LIVE_SEEKED = "is-live-seeked";
691
+
692
+ /**
693
+ * @public
694
+ */
695
+ declare type LiveEventDetail = null;
696
+
697
+ /**
698
+ * @public
699
+ */
700
+ declare const /**
701
+ @public
702
+ * when a new player is inserted into the HTML
703
+ */ /**
704
+ * @public
705
+ */
706
+ LOAD = "load";
707
+
708
+ /**
709
+ * @public
710
+ */
711
+ declare const /**
712
+ @public
713
+ * when a new player is inserted into the HTML
714
+ */ /**
715
+ * @public
716
+ */
717
+ LOAD_START = "loadstart";
718
+
719
+ declare const LOADED = "is-loaded";
720
+
721
+ /**
722
+ * @public A plugin that supports loading new media formats. Use 'class MyPlugin implements Loader\<...\>' when writing your custom Loader
723
+ * @typeParam PluginPlayer- Player API that will be implemented by the loader. Loader at least must implement on(\<loader-name\>:attached, ...) event handler
724
+ */
725
+ declare interface Loader<PluginOwnConfig extends KeyValue, // FIXME extends Config
726
+ PluginPlayer extends PlayerWith<_AttachedEventCheck>> extends Plugin_2<PluginOwnConfig, PluginPlayer> {
727
+ onload: EnsureOnAttached<(config: ConfigWith<PluginOwnConfig>, root: PlayerRoot, video: PlayerWith<PluginPlayer>, src: SourceObj) => void, PluginPlayer>;
728
+ wants<S = SourceObj>(srcString: SourceStr, srcObj: S, config: ConfigWith<PluginOwnConfig>): boolean;
729
+ wants<S = KeyValue>(srcString: SourceStr, srcObj: SourceWith<S>, config: ConfigWith<PluginOwnConfig>): boolean;
730
+ }
731
+
732
+ declare const LOADING = "is-loading";
733
+
734
+ declare type MapToConfigs<Arr extends PluginCtor[]> = {
735
+ [PluginType in keyof Arr]: Arr[PluginType] extends PluginCtor<ConfigWith<infer ConfigType>> ? ConfigType : never;
736
+ };
737
+
738
+ declare type MapToPlayerApiExtensions<Arr extends PluginCtor[]> = {
739
+ [PluginType in keyof Arr]: Arr[PluginType] extends PluginCtor<infer _uConfigType, PlayerWith<infer PlayerAPIExtension>> ? PlayerAPIExtension : never;
740
+ };
741
+
742
+ declare const MENU_OPENED = "has-menu-opened";
743
+
744
+ declare type MergeConfigs<Arr extends PluginCtor[]> = ArrayToIntersection<MapToConfigs<Arr>>;
745
+
746
+ declare type MergePlayerAPIExtensions<Arr extends PluginCtor[]> = ArrayToIntersection<MapToPlayerApiExtensions<Arr>>;
747
+
748
+ /**
749
+ * @public
750
+ * general video events flowplayer uses internally
751
+ * https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Media_events
752
+ */
753
+ declare const /**
754
+ @public
755
+ * when a new player is inserted into the HTML
756
+ */ /**
757
+ * @public
758
+ * general video events flowplayer uses internally
759
+ * https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Media_events
760
+ */
761
+ METADATA = "loadedmetadata";
762
+
763
+ /**
764
+ @public
765
+ * when a new player is inserted into the HTML
766
+ */
767
+ declare const /**
768
+ @public
769
+ * when a new player is inserted into the HTML
770
+ */ /**
771
+ @public
772
+ * when a new player is inserted into the HTML
773
+ */ MOUNT = "mount";
774
+
775
+ /**
776
+ * @public
777
+ */
778
+ declare type MountEventDetail = null;
779
+
780
+ /**
781
+ * @public
782
+ */
783
+ declare const /**
784
+ @public
785
+ * when a new player is inserted into the HTML
786
+ */ /**
787
+ * @public
788
+ */
789
+ MOUSE_DOWN = "mousedown";
790
+
791
+ /**
792
+ * @public
793
+ */
794
+ declare const /**
795
+ @public
796
+ * when a new player is inserted into the HTML
797
+ */ /**
798
+ * @public
799
+ */
800
+ MOUSE_ENTER = "mouseenter";
801
+
802
+ /**
803
+ * @public
804
+ */
805
+ declare const /**
806
+ @public
807
+ * when a new player is inserted into the HTML
808
+ */ /**
809
+ * @public
810
+ */
811
+ MOUSE_LEAVE = "mouseleave";
812
+
813
+ /**
814
+ * @public
815
+ */
816
+ declare const /**
817
+ @public
818
+ * when a new player is inserted into the HTML
819
+ */ /**
820
+ * @public
821
+ */
822
+ MOUSE_MOVE = "mousemove";
823
+
824
+ /**
825
+ * @public
826
+ */
827
+ declare const /**
828
+ @public
829
+ * when a new player is inserted into the HTML
830
+ */ /**
831
+ * @public
832
+ */
833
+ MOUSE_UP = "mouseup";
834
+
835
+ declare const MUTED = "is-muted";
836
+
837
+ declare const NO_CONTROLS = "no-controls";
838
+
839
+ declare const NO_DVR = "no-timeline";
840
+
841
+ /* Excluded from this release type: NON_RECOVERABLE_ERROR */
842
+
843
+ /* Excluded from this release type: NonRecoverableErrorEventDetail */
844
+
845
+ /* Excluded from this release type: NQState */
846
+
847
+ /**
848
+ * @public
849
+ */
850
+ declare type OVPMetadata = {
851
+ player_id?: string;
852
+ media_id?: string;
853
+ ad_keywords?: string;
854
+ title?: string;
855
+ description?: string;
856
+ category_name?: string;
857
+ duration?: number;
858
+ tags?: string;
859
+ };
860
+
861
+ /**
862
+ * @public
863
+ */
864
+ declare const /**
865
+ @public
866
+ * when a new player is inserted into the HTML
867
+ */ /**
868
+ * @public
869
+ */
870
+ PAUSE = "pause";
871
+
872
+ declare const PAUSED = "is-paused";
873
+
874
+ /**
875
+ * @public
876
+ */
877
+ declare const /**
878
+ @public
879
+ * when a new player is inserted into the HTML
880
+ */ /**
881
+ * @public
882
+ */
883
+ PLAY = "play";
884
+
885
+ /**
886
+ * @public
887
+ */
888
+ declare type Player = HTMLVideoElement & PlayerEventOverloads & {
889
+ /* Excluded from this release type: renderPlugin */
890
+ /**
891
+ * Disables and enables the player.
892
+ * @param flag -Forces disabled mode (true) or enabled mode (false). Disabled player cannot be seeked forward.
893
+ */
894
+ toggleDisable: (flag?: boolean) => void;
895
+ /* Excluded from this release type: original_src */
896
+ /**
897
+ * The root element of the video player. This is the immediate parent element of the video tag.
898
+ */
899
+ root: PlayerRoot;
900
+ /* Excluded from this release type: playerState */
901
+ /* Excluded from this release type: reaper */
902
+ /* Excluded from this release type: hasState */
903
+ /* Excluded from this release type: transitionState */
904
+ /**
905
+ * Toggles between playing and paused mode.
906
+ * @param on - Forces the playback (true) or paused state (false). Use this for initial playback of a source configured with setSrc() and when changing the state.
907
+ */
908
+ togglePlay(on?: boolean): Promise<void>;
909
+ /* Excluded from this release type: toggleFullScreen */
910
+ /**
911
+ * @public
912
+ * Toggles between normal and fullscreen mode. The optional flag attribute forces the normal sized (false) or fullscreen (false) mode.
913
+ * The custom fullscreenenter and fullscreenexit events are sent respectively.
914
+ */
915
+ toggleFullScreen(on?: boolean): void;
916
+ /* Excluded from this release type: toggleMute */
917
+ /**
918
+ * Toggles between muted and original volume level.
919
+ */
920
+ toggleMute(): void;
921
+ /**
922
+ * Removes a Flowplayer instance from `flowplayer.instances` and emits the `flowplayer.events.REAP` event, enabling cleanup of unsafe resources.
923
+ */
924
+ destroy(): void;
925
+ /* Excluded from this release type: render */
926
+ /* Excluded from this release type: render */
927
+ createComponents(...args: string[]): HTMLElement[];
928
+ /**
929
+ * Adds or changes configuration object. Usually used in conjunction with `setSrc()`. You can use all top-level config options like `subtitle:` , `logo:`, `ima:` etc.
930
+ * @example
931
+ * ```
932
+ * setOpts({
933
+ * subtitles:{
934
+ * tracks:[
935
+ * {
936
+ * src: "1.vtt",
937
+ * label: "English",
938
+ * default: true
939
+ * }, {
940
+ * src: "2.vtt",
941
+ * label: "Spanish",
942
+ * default : false }]},
943
+ * logo: "https://myserver.com/logo.png"
944
+ * })
945
+ * ```
946
+ */
947
+ setOpts(config: Config): void;
948
+ /**
949
+ * Sets the video source to be played. The src attribute can be a string or an object similar to the src property.
950
+ */
951
+ setSrc(sources: UnsafeSource): void;
952
+ /* Excluded from this release type: setSrc */
953
+ /* Excluded from this release type: setAttrs */
954
+ /* Excluded from this release type: opt */
955
+ /* Excluded from this release type: enqueueSeek */
956
+ /* Excluded from this release type: setState */
957
+ setState(state: PlayerState, flag: boolean): void;
958
+ /* Excluded from this release type: toJSON */
959
+ /**
960
+ * Adds a language to the project. See {@link https://developer.wowza.com/docs/wowza-flowplayer/player/translations/#using-npm| Official documentation}
961
+ */
962
+ i18n(k: string, fallback?: string): string;
963
+ /* Excluded from this release type: deviceId */
964
+ /* Excluded from this release type: live_state */
965
+ /**
966
+ * A reference to the configuration state of the player.
967
+ */
968
+ opts: Config;
969
+ /* Excluded from this release type: plugins */
970
+ /* Excluded from this release type: dvr_offset */
971
+ message?: {
972
+ events: Record<string, string>;
973
+ };
974
+ /**
975
+ * A boolean specifying whether the player is disabled and the user cannot seek forward using the mouse or keyboard.
976
+ * Player is disabled and enabled with the `toggleDisable()` method.
977
+ */
978
+ disabled: boolean;
979
+ /* Excluded from this release type: started */
980
+ /* Excluded from this release type: token */
981
+ tracks?: VideoTrack[];
982
+ /* Excluded from this release type: _customElements */
983
+ /* Excluded from this release type: _storage */
984
+ };
985
+
986
+ declare type PlayerCustomEventName = keyof PlayerCustomEventsDetailMap;
987
+
988
+ declare type PlayerCustomEventsDetailMap = {
989
+ [MOUNT]: MountEventDetail;
990
+ [ERROR]: ErrorEventDetail;
991
+ [CONTEXT_MENU]: ContextMenuEventDetail;
992
+ /* Excluded from this release type: beforeplay */
993
+ /* Excluded from this release type: beforepause */
994
+ /* Excluded from this release type: state */
995
+ [CUEPOINT_START]: CuePointStartEventDetail;
996
+ [CUEPOINT_END]: CuePointEndEventDetail;
997
+ [VIEW_ENTER]: ViewEnterEventDetail;
998
+ [VIEW_LEAVE]: ViewLeaveEventDetail;
999
+ [SOURCE]: SourceEventDetail;
1000
+ /* Excluded from this release type: recover */
1001
+ [REAP]: ReapEventDetail;
1002
+ /* Excluded from this release type: config */
1003
+ [QUALITIES]: QualitiesEventDetail;
1004
+ /* Excluded from this release type: "error:fatal" */
1005
+ [RECOMMENDATIONS_READY]: RecommendationsReadyEventDetail;
1006
+ /* Excluded from this release type: audioonlysource */
1007
+ /* Excluded from this release type: renderplugin */
1008
+ [DVR]: DvrEventDetail;
1009
+ [LIVE_2]: LiveEventDetail;
1010
+ /* Excluded from this release type: "seek:queued" */
1011
+ /* Excluded from this release type: "seek:cancel" */
1012
+ /* Excluded from this release type: "plugin:registered" */
1013
+ /* Excluded from this release type: intersectionchange */
1014
+ /* Excluded from this release type: retry */
1015
+ };
1016
+
1017
+ declare type PlayerCustomEventsOverloads = {
1018
+ /**
1019
+ * Sent when the player interface is completely rendered and you can access all the elements with CSS and JavaScript. Due to the way mounting works, this event is only accessible inside of a custom extension.
1020
+ */
1021
+ on(event: typeof MOUNT, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof MOUNT]>) => void): Player;
1022
+ /**
1023
+ * Sent when an error occurs. Learn more about error handling.
1024
+ */
1025
+ on(event: typeof ERROR, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof ERROR]>) => void): Player;
1026
+ on(// FIXME - this event is in context-menu plugin
1027
+ event: typeof CONTEXT_MENU, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof CONTEXT_MENU]>) => void): Player;
1028
+ /* Excluded from this release type: on */
1029
+ /* Excluded from this release type: on */
1030
+ /* Excluded from this release type: on */
1031
+ /**
1032
+ * TODO - move to Cuepoints? Sent when a configured cuepoint is entered.
1033
+ */
1034
+ on(event: typeof CUEPOINT_START, // TODO: move to Cuepoints
1035
+ handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof CUEPOINT_START]>) => void): Player;
1036
+ /**
1037
+ * Sent when a configured cuepoint is terminated.
1038
+ */
1039
+ on(event: typeof CUEPOINT_END, // TODO: move to Cuepoints
1040
+ handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof CUEPOINT_END]>) => void): Player;
1041
+ /**
1042
+ * Sent when the player becomes visible for the user.
1043
+ */
1044
+ on(event: typeof VIEW_ENTER, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof VIEW_ENTER]>) => void): Player;
1045
+ /**
1046
+ * Sent when the player leaves the users viewport and is longer visible.
1047
+ */
1048
+ on(event: typeof VIEW_LEAVE, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof VIEW_LEAVE]>) => void): Player;
1049
+ /**
1050
+ * Sent right before the player src attribute is set. This allows you to change the video URL before playback.
1051
+ */
1052
+ on(event: typeof SOURCE, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof SOURCE]>) => void): Player;
1053
+ /* Excluded from this release type: on */
1054
+ /**
1055
+ * Sent when a flowplayer instance is about to be removed from the DOM, and any unsafe references are about to be reaped, which allows Single Page Applications to perform the necessary resource cleanups. This is important when working with front-end frameworks like React. This event should never be emitted directly, only listened to.
1056
+ */
1057
+ on(event: typeof REAP, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof REAP]>) => void): Player;
1058
+ /* Excluded from this release type: on */
1059
+ /**
1060
+ * Emitted when the set of underlying qualities has changed.
1061
+ */
1062
+ on(event: typeof QUALITIES, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof QUALITIES]>) => void): Player;
1063
+ /* Excluded from this release type: on */
1064
+ /**
1065
+ * Listen to this event to create a recommendations grid using the data passed with the event.
1066
+ */
1067
+ on(event: typeof RECOMMENDATIONS_READY, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof RECOMMENDATIONS_READY]>) => void): Player;
1068
+ /* Excluded from this release type: on */
1069
+ /* Excluded from this release type: on */
1070
+ /**
1071
+ * when the player has started playing dvr content
1072
+ */
1073
+ on(event: typeof DVR, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof DVR]>) => void): Player;
1074
+ /**
1075
+ * when src is a livestream
1076
+ */
1077
+ on(event: typeof LIVE_2, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof LIVE_2]>) => void): Player;
1078
+ /* Excluded from this release type: on */
1079
+ /* Excluded from this release type: on */
1080
+ /* Excluded from this release type: on */
1081
+ /* Excluded from this release type: on */
1082
+ /* Excluded from this release type: on */
1083
+ on<T>(event: string, handler: (e: FPEvent<T>) => void): Player;
1084
+ /* Excluded from this release type: on */
1085
+ /**
1086
+ * Same as `on()`, but the handler function is executed only once.
1087
+ */
1088
+ once<T extends PlayerCustomEventName>(event: T, handler: (e: FPEvent<PlayerCustomEventsDetailMap[T]>) => void): Player;
1089
+ /**
1090
+ * Same as `on()`, but the handler function is executed only once.
1091
+ */
1092
+ once<T extends PlayerNativeEventName>(event: T, handler: (e: PlayerNativeEventsDetailMap[T]) => void): Player;
1093
+ once<T>(event: string, handler: (e: FPEvent<T>) => void): Player;
1094
+ /**
1095
+ * Removes the event handler with the specified event type.
1096
+ */
1097
+ off<T extends PlayerCustomEventName>(event: T, handler: (e: FPEvent<PlayerCustomEventsDetailMap[T]>) => void): Player;
1098
+ /**
1099
+ * Removes the event handler with the specified event type.
1100
+ */
1101
+ off<T extends PlayerNativeEventName>(event: T, handler: (e: PlayerNativeEventsDetailMap[T]) => void): Player;
1102
+ /**
1103
+ * Removes the event handler with the specified event type.
1104
+ */
1105
+ off<T>(event: string, handler: (e: FPEvent<T>) => void): Player;
1106
+ /* Excluded from this release type: poll */
1107
+ emit<T extends PlayerCustomEventName>(event: T, data?: PlayerCustomEventsDetailMap[T]): Player;
1108
+ /* Excluded from this release type: emit */
1109
+ emit<T, X extends string = string>(event: X & (X extends PlayerCustomEventName ? "Incorrect event detail type" : X), data?: T): Player;
1110
+ };
1111
+
1112
+ declare type PlayerEventOverloads = PlayerNativeEventsOverloads & PlayerCustomEventsOverloads;
1113
+
1114
+ declare type PlayerNativeEventName = keyof PlayerNativeEventsDetailMap;
1115
+
1116
+ declare type PlayerNativeEventsDetailMap = Omit<HTMLVideoElementEventMap, "error">;
1117
+
1118
+ declare type PlayerNativeEventsOverloads = {
1119
+ on<K extends keyof PlayerNativeEventsDetailMap>(event: K, handler: (ev: PlayerNativeEventsDetailMap[K]) => void): Player;
1120
+ };
1121
+
1122
+ /**
1123
+ * @public
1124
+ * The root element of the video player. This is the immediate parent element of the video tag.
1125
+ */
1126
+ declare type PlayerRoot = HTMLElement & {
1127
+ /* Excluded from this release type: prevWidth */
1128
+ };
1129
+
1130
+ /**
1131
+ * @public
1132
+ */
1133
+ declare type PlayerState = FlowplayerStates[keyof FlowplayerStates];
1134
+
1135
+ /* Excluded from this release type: _PlayerState */
1136
+
1137
+ /* Excluded from this release type: PlayerStates */
1138
+
1139
+ /**
1140
+ * @public
1141
+ */
1142
+ declare type PlayerWith<T> = T & Player;
1143
+
1144
+ declare const PLAYING = "is-playing";
1145
+
1146
+ /**
1147
+ * @public
1148
+ */
1149
+ declare const /**
1150
+ @public
1151
+ * when a new player is inserted into the HTML
1152
+ */ /**
1153
+ * @public
1154
+ */
1155
+ PLAYING_2 = "playing";
1156
+
1157
+ /**
1158
+ * @public
1159
+ */
1160
+ declare interface Plugin_2<PluginConfig extends Config = Config, PluginPlayer extends Player = Player> {
301
1161
  /**
302
1162
  * a plugin must always implement the init method so a player instance knows how to initialize it
303
1163
  */
304
- init(config: ConfigWith<PluginOwnConfig>, container: PlayerRoot, player: PlayerWith<PluginPlayerAPIExtension>): void;
1164
+ init(config: PluginConfig, container: PlayerRoot, player: PluginPlayer): void;
305
1165
  }
306
1166
 
307
- declare interface PluginCtor<PluginOwnConfig extends KeyValue = KeyValue, PluginPlayerAPIExtension extends KeyValue = KeyValue> {
308
- new (umd: FlowplayerUMD, player: PlayerWith<PluginPlayerAPIExtension>): Plugin_2<PluginOwnConfig, PluginPlayerAPIExtension>;
1167
+ /* Excluded from this release type: PLUGIN_REGISTERED */
1168
+
1169
+ /**
1170
+ * @public
1171
+ */
1172
+ declare interface PluginCtor<PluginConfig extends Config = Config, PluginPlayer extends Player = Player> {
1173
+ new (umd: FlowplayerUMD, player: PluginPlayer): Plugin_2<PluginConfig, PluginPlayer>;
309
1174
  }
310
1175
 
1176
+ /* Excluded from this release type: PluginRegisteredEventDetail */
1177
+
1178
+ declare type PluginStates = string;
1179
+
1180
+ /**
1181
+ * @public
1182
+ */
1183
+ declare const /**
1184
+ @public
1185
+ * when a new player is inserted into the HTML
1186
+ */ /**
1187
+ * @public
1188
+ */
1189
+ PORTRAIT = "portrait";
1190
+
1191
+ /**
1192
+ * @public
1193
+ */
1194
+ declare const /**
1195
+ @public
1196
+ * when a new player is inserted into the HTML
1197
+ */ /**
1198
+ * @public
1199
+ */
1200
+ PROGRESS = "progress";
1201
+
1202
+ /**
1203
+ * @public
1204
+ * emitted whenever a list of qualities has been made available
1205
+ * when index 0 is the highest quality and index 0+N is the lowest
1206
+ */
1207
+ declare const /**
1208
+ @public
1209
+ * when a new player is inserted into the HTML
1210
+ */ /**
1211
+ * @public
1212
+ * emitted whenever a list of qualities has been made available
1213
+ * when index 0 is the highest quality and index 0+N is the lowest
1214
+ */
1215
+ QUALITIES = "qualities";
1216
+
1217
+ /**
1218
+ * @public
1219
+ */
1220
+ declare type QualitiesEventDetail = QualityDetail[];
1221
+
1222
+ /**
1223
+ * @public
1224
+ */
1225
+ declare type QualityDetail = {
1226
+ level: number;
1227
+ text: string;
1228
+ width: number;
1229
+ height: number;
1230
+ videoCodec: string;
1231
+ } | BitrateInfo | {
1232
+ text: string | number;
1233
+ encodingId: string;
1234
+ spatialLayerId: number;
1235
+ temporalLayerId: number;
1236
+ maxSpatialLayerId: number;
1237
+ maxTemporalLayerId: number;
1238
+ height: number;
1239
+ width: number;
1240
+ };
1241
+
311
1242
  declare enum QualityOpts {
312
1243
  LOW = 1,
313
1244
  MEDIUM = 2,
314
1245
  HIGH = 4
315
1246
  }
316
1247
 
1248
+ /**
1249
+ * @public
1250
+ * emitted when it is safe to clean up a fp instance
1251
+ */
1252
+ declare const /**
1253
+ @public
1254
+ * when a new player is inserted into the HTML
1255
+ */ /**
1256
+ * @public
1257
+ * emitted when it is safe to clean up a fp instance
1258
+ */
1259
+ REAP = "reap";
1260
+
1261
+ /**
1262
+ * @public
1263
+ */
1264
+ declare type ReapEventDetail = null;
1265
+
1266
+ /**
1267
+ * @public
1268
+ */
1269
+ declare type RecommendationItem = {
1270
+ poster?: string;
1271
+ src?: UnsafeSource;
1272
+ title?: string;
1273
+ description?: string;
1274
+ metadata: OVPMetadata;
1275
+ chapters?: {
1276
+ src: string;
1277
+ };
1278
+ thumbnails?: {
1279
+ src: string;
1280
+ };
1281
+ subtitles?: string[];
1282
+ };
1283
+
1284
+ /**
1285
+ * @public
1286
+ */
1287
+ declare const /**
1288
+ @public
1289
+ * when a new player is inserted into the HTML
1290
+ */ /**
1291
+ * @deprecated please use Endscreen.events.RECOMMENDATIONS_READY / flowplayer.endscreen.events.RECOMMENDATIONS_READY
1292
+ **/
1293
+ /**
1294
+ * @public
1295
+ */
1296
+ RECOMMENDATIONS_READY = "recommendationsready";
1297
+
1298
+ /**
1299
+ * @public
1300
+ */
1301
+ declare type RecommendationsReadyEventDetail = {
1302
+ playlist: RecommendationItem[];
1303
+ };
1304
+
1305
+ /* Excluded from this release type: RECOVER */
1306
+
1307
+ /* Excluded from this release type: RecoverEventDetail */
1308
+
1309
+ /* Excluded from this release type: REMOTE_SESSION_ENDED */
1310
+
1311
+ /* Excluded from this release type: REMOTE_SESSION_STARTED */
1312
+
1313
+ /* Excluded from this release type: RENDER_PLUGIN */
1314
+
1315
+ /**
1316
+ * @public
1317
+ */
1318
+ declare type RenderPluginEventDetail = HTMLElement;
1319
+
1320
+ /**
1321
+ * @public
1322
+ */
1323
+ declare const /**
1324
+ @public
1325
+ * when a new player is inserted into the HTML
1326
+ */ /**
1327
+ * @public
1328
+ */
1329
+ RESIZE = "resize";
1330
+
1331
+ /* Excluded from this release type: RETRY */
1332
+
1333
+ /* Excluded from this release type: RetryEventDetail */
1334
+
1335
+ declare const RTL = "is-rtl";
1336
+
1337
+ /**
1338
+ * @public
1339
+ */
1340
+ declare const /**
1341
+ @public
1342
+ * when a new player is inserted into the HTML
1343
+ */ /**
1344
+ * @public
1345
+ */
1346
+ SCROLL = "scroll";
1347
+
1348
+ declare const SEAMLESS = "is-seamless";
1349
+
1350
+ /* Excluded from this release type: SEEK_CANCEL */
1351
+
1352
+ /* Excluded from this release type: SEEK_QUEUED */
1353
+
1354
+ declare const SEEKABLE = "is-seekable";
1355
+
1356
+ /* Excluded from this release type: SeekCancelEventDetail */
1357
+
1358
+ /**
1359
+ * @public
1360
+ */
1361
+ declare const /**
1362
+ @public
1363
+ * when a new player is inserted into the HTML
1364
+ */ /**
1365
+ * @public
1366
+ */
1367
+ SEEKED = "seeked";
1368
+
1369
+ declare const SEEKING = "is-seeking";
1370
+
1371
+ /**
1372
+ * @public
1373
+ */
1374
+ declare const /**
1375
+ @public
1376
+ * when a new player is inserted into the HTML
1377
+ */ /**
1378
+ * @public
1379
+ */
1380
+ SEEKING_2 = "seeking";
1381
+
1382
+ /* Excluded from this release type: SeekQueuedEventDetail */
1383
+
1384
+ /**
1385
+ * @public
1386
+ * allows plugins to listen for forced quality changes
1387
+ * it should emit the index of the quality to set
1388
+ * -1 is a special idx saying to use ABR if the plugin
1389
+ * exposes an ABR implementation
1390
+ */
1391
+ declare const /**
1392
+ @public
1393
+ * when a new player is inserted into the HTML
1394
+ */ /**
1395
+ * @public
1396
+ * allows plugins to listen for forced quality changes
1397
+ * it should emit the index of the quality to set
1398
+ * -1 is a special idx saying to use ABR if the plugin
1399
+ * exposes an ABR implementation
1400
+ */
1401
+ SET_QUALITY = "quality:set";
1402
+
1403
+ declare const SMALL = "is-small";
1404
+
1405
+ /**
1406
+ * @public
1407
+ * emitted when a valid source is found prior to mounting
1408
+ */
1409
+ declare const /**
1410
+ @public
1411
+ * when a new player is inserted into the HTML
1412
+ */ /**
1413
+ * @public
1414
+ * emitted when a valid source is found prior to mounting
1415
+ */
1416
+ SOURCE = "src";
1417
+
1418
+ /**
1419
+ * @public
1420
+ */
1421
+ declare type SourceEventDetail = SourceObj;
1422
+
1423
+ /**
1424
+ * @public
1425
+ */
317
1426
  declare type SourceObj = {
318
1427
  src?: SourceStr;
1428
+ /**
1429
+ * the MIME type (example `video/mp4` or `application/x-mpegurl`)
1430
+ */
319
1431
  type?: string;
320
1432
  drm?: DRMSourceConfiguration;
321
1433
  };
322
1434
 
1435
+ /**
1436
+ * @public
1437
+ */
323
1438
  declare type SourceStr = string;
324
1439
 
1440
+ /**
1441
+ * @public
1442
+ */
325
1443
  declare type SourceWith<T> = SourceObj & T;
326
1444
 
1445
+ declare const STARTING = "is-starting";
1446
+
1447
+ /* Excluded from this release type: STATE */
1448
+
1449
+ /* Excluded from this release type: StateEventDetail */
1450
+
1451
+ declare namespace states {
1452
+ export {
1453
+ PLAYING,
1454
+ FULLSCREEN,
1455
+ PAUSED,
1456
+ MUTED,
1457
+ LOADED,
1458
+ LOADING,
1459
+ STARTING,
1460
+ SEEKING,
1461
+ GRABBING,
1462
+ DISABLED,
1463
+ SMALL,
1464
+ TINY,
1465
+ RTL,
1466
+ TV,
1467
+ ENDED,
1468
+ LIVE,
1469
+ ERRORED,
1470
+ WAITING,
1471
+ AUTOPLAY,
1472
+ SEAMLESS,
1473
+ TOGGLING,
1474
+ LIVE_SEEKED,
1475
+ NO_DVR,
1476
+ HAS_POSTER,
1477
+ WILL_PLAY,
1478
+ WILL_PAUSE,
1479
+ MENU_OPENED,
1480
+ TOUCHED,
1481
+ HOVERED,
1482
+ TOUCH_DEVICE,
1483
+ WILL_SEEK,
1484
+ SEEKABLE,
1485
+ IN_VIEWPORT,
1486
+ NO_CONTROLS,
1487
+ DESTROYED,
1488
+ IS_SOURCE_PROCESSING
1489
+ }
1490
+ }
1491
+
1492
+ /**
1493
+ * @public
1494
+ */
1495
+ declare const /**
1496
+ @public
1497
+ * when a new player is inserted into the HTML
1498
+ */ /**
1499
+ * @public
1500
+ */
1501
+ TIME_UPDATE = "timeupdate";
1502
+
1503
+ declare const TINY = "is-tiny";
1504
+
1505
+ declare const TOGGLING = "is-toggling";
1506
+
1507
+ /**
1508
+ * @public
1509
+ */
1510
+ declare const /**
1511
+ @public
1512
+ * when a new player is inserted into the HTML
1513
+ */ /**
1514
+ * @public
1515
+ */
1516
+ TOUCH_CANCEL = "touchcancel";
1517
+
1518
+ declare const TOUCH_DEVICE = "is-touch-device";
1519
+
1520
+ /**
1521
+ * @public
1522
+ */
1523
+ declare const /**
1524
+ @public
1525
+ * when a new player is inserted into the HTML
1526
+ */ /**
1527
+ * @public
1528
+ */
1529
+ TOUCH_END = "touchend";
1530
+
1531
+ /**
1532
+ * @public
1533
+ */
1534
+ declare const /**
1535
+ @public
1536
+ * when a new player is inserted into the HTML
1537
+ */ /**
1538
+ * @public
1539
+ */
1540
+ TOUCH_MOVE = "touchmove";
1541
+
1542
+ /**
1543
+ * @public
1544
+ */
1545
+ declare const /**
1546
+ @public
1547
+ * when a new player is inserted into the HTML
1548
+ */ /**
1549
+ * @public
1550
+ */
1551
+ TOUCH_START = "touchstart";
1552
+
1553
+ declare const TOUCHED = "is-touched";
1554
+
1555
+ declare const TV = "is-tv";
1556
+
1557
+ /**
1558
+ * @public
1559
+ */
327
1560
  declare type UnsafeSource = SourceStr | SourceObj | Array<SourceStr | SourceObj>;
328
1561
 
1562
+ /**
1563
+ * @public
1564
+ * emitted when a video track is selected
1565
+ */
1566
+ declare const /**
1567
+ @public
1568
+ * when a new player is inserted into the HTML
1569
+ */ /**
1570
+ * @public
1571
+ * emitted when a video track is selected
1572
+ */
1573
+ VIDEO_TRACK_SELECT = "tracks:video:select";
1574
+
1575
+ /**
1576
+ * @public
1577
+ * emitted whenever multiple video tracks are detected
1578
+ */
1579
+ declare const /**
1580
+ @public
1581
+ * when a new player is inserted into the HTML
1582
+ */ /**
1583
+ * @public
1584
+ * emitted whenever multiple video tracks are detected
1585
+ */
1586
+ VIDEO_TRACKS = "videoTracks";
1587
+
1588
+ /**
1589
+ * @public
1590
+ */
329
1591
  declare interface VideoTrack {
330
1592
  name: string;
331
- data: any;
1593
+ /* Excluded from this release type: data */
332
1594
  default: boolean;
333
1595
  selected: boolean;
334
1596
  }
335
1597
 
1598
+ /**
1599
+ * @public
1600
+ * when a player enters the viewpoint
1601
+ */
1602
+ declare const /**
1603
+ @public
1604
+ * when a new player is inserted into the HTML
1605
+ */ /**
1606
+ * @public
1607
+ * when a player enters the viewpoint
1608
+ */
1609
+ VIEW_ENTER = "viewenter";
1610
+
1611
+ /**
1612
+ * @public
1613
+ * when a player leaves the viewport
1614
+ */
1615
+ declare const /**
1616
+ @public
1617
+ * when a new player is inserted into the HTML
1618
+ */ /**
1619
+ * @public
1620
+ * when a player leaves the viewport
1621
+ */
1622
+ VIEW_LEAVE = "viewleave";
1623
+
1624
+ /**
1625
+ * @public
1626
+ */
1627
+ declare type ViewEnterEventDetail = null;
1628
+
1629
+ /**
1630
+ * @public
1631
+ */
1632
+ declare type ViewLeaveEventDetail = null;
1633
+
1634
+ /**
1635
+ * @public
1636
+ */
1637
+ declare const /**
1638
+ @public
1639
+ * when a new player is inserted into the HTML
1640
+ */ /**
1641
+ * @public
1642
+ */
1643
+ VOLUME_CHANGE = "volumechange";
1644
+
1645
+ declare const WAITING = "is-waiting";
1646
+
1647
+ /**
1648
+ * @public
1649
+ */
1650
+ declare const /**
1651
+ @public
1652
+ * when a new player is inserted into the HTML
1653
+ */ /**
1654
+ * @public
1655
+ */
1656
+ WAITING_2 = "waiting";
1657
+
1658
+ /* Excluded from this release type: WEBKIT_NEEDKEY */
1659
+
1660
+ declare const WILL_PAUSE = "will-pause";
1661
+
1662
+ declare const WILL_PLAY = "will-play";
1663
+
1664
+ declare const WILL_SEEK = "will-seek";
1665
+
336
1666
  export { }