@flowplayer/player 3.19.0 → 3.20.0-rc.6

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 (60) hide show
  1. package/core/events.d.ts +13 -0
  2. package/core/events.js +7 -2
  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 +119 -25
  8. package/package.json +1 -1
  9. package/plugins/ads.d.ts +120 -26
  10. package/plugins/ads.js +1 -1
  11. package/plugins/airplay.d.ts +120 -26
  12. package/plugins/analytics.d.ts +120 -26
  13. package/plugins/analytics.js +1 -1
  14. package/plugins/asel.d.ts +120 -26
  15. package/plugins/audio.d.ts +120 -26
  16. package/plugins/chapters.d.ts +120 -26
  17. package/plugins/chromecast.d.ts +146 -34
  18. package/plugins/chromecast.js +1 -1
  19. package/plugins/comscore.d.ts +120 -26
  20. package/plugins/consent.d.ts +120 -26
  21. package/plugins/context-menu.d.ts +120 -26
  22. package/plugins/cuepoints.d.ts +120 -26
  23. package/plugins/dash.d.ts +119 -25
  24. package/plugins/dash.js +1 -1
  25. package/plugins/drm.d.ts +120 -26
  26. package/plugins/endscreen.d.ts +120 -26
  27. package/plugins/fas.d.ts +120 -26
  28. package/plugins/float-on-scroll.d.ts +120 -26
  29. package/plugins/ga4.d.ts +120 -26
  30. package/plugins/ga4.js +1 -1
  31. package/plugins/gemius.d.ts +120 -26
  32. package/plugins/google-analytics.d.ts +120 -26
  33. package/plugins/google-analytics.js +1 -1
  34. package/plugins/hls.d.ts +120 -26
  35. package/plugins/hls.js +1 -1
  36. package/plugins/id3.d.ts +120 -26
  37. package/plugins/iframe.d.ts +119 -25
  38. package/plugins/keyboard.d.ts +120 -26
  39. package/plugins/media-session.d.ts +120 -26
  40. package/plugins/message.d.ts +120 -26
  41. package/plugins/ovp.d.ts +120 -26
  42. package/plugins/playlist.d.ts +125 -26
  43. package/plugins/playlist.js +1 -1
  44. package/plugins/preview.d.ts +120 -26
  45. package/plugins/qsel.d.ts +120 -26
  46. package/plugins/qsel.js +1 -1
  47. package/plugins/qul.d.ts +120 -26
  48. package/plugins/rts.d.ts +120 -26
  49. package/plugins/rts.js +2 -2
  50. package/plugins/share.d.ts +153 -26
  51. package/plugins/speed.d.ts +141 -30
  52. package/plugins/ssai.d.ts +120 -28
  53. package/plugins/ssai.js +2 -2
  54. package/plugins/subtitles.d.ts +120 -26
  55. package/plugins/thumbnails.d.ts +135 -30
  56. package/plugins/tizen.d.ts +120 -26
  57. package/plugins/vtsel.d.ts +119 -26
  58. package/plugins/webos.d.ts +120 -26
  59. package/util/loader.d.ts +120 -26
  60. package/util/loader.js +0 -1
@@ -1,7 +1,11 @@
1
1
  /// <reference types="node" />
2
2
 
3
3
  import type { BitrateInfo } from 'dashjs';
4
+ import type { Get } from 'type-fest';
5
+ import type { Level } from 'hls.js';
4
6
  import type { MediaKeyFunc } from 'hls.js';
7
+ import type { SetFieldType } from 'type-fest';
8
+ import type { TupleToUnion } from 'type-fest';
5
9
 
6
10
  /* Excluded from this release type: AnyLoader */
7
11
 
@@ -79,6 +83,26 @@ declare const /**
79
83
  */
80
84
  CLICK = "click";
81
85
 
86
+ /**
87
+ * For plugins that add new properties to all source types, combine their src-mixins into one SourceObject
88
+ * @example
89
+ * ```
90
+ * type Combined = CombineGlobalSrcExtensions<DRMPlugin, PluginWithFooFieldInSrc> // Combined = SourceObject<DRMConfig & FooFieldConfig>
91
+ * ```
92
+ */
93
+ declare type CombineGlobalSrcExtensions<PluginSrcs extends unknown[]> = HasGlobalSrcExtensios<PluginSrcs> extends false ? SourceObj : SourceObj & ArrayToIntersection<PickGlobalSrcExtension<PluginSrcs>>;
94
+
95
+ /**
96
+ * For plugins that define a new src type, make a union of all new src.type declarations
97
+ * @example
98
+ * ```
99
+ * type Combined = CombineNewSourceTypes<RTSPlugin, SSAIPlugin> // Combined = DRMConfig | FooFieldConfig
100
+ * ```
101
+ */
102
+ declare type CombineNewSourceTypes<PluginSrcs extends unknown[]> = TupleToUnion<FilterNewSourceTypes<PluginSrcs>>;
103
+
104
+ declare type CombineSrc<PluginSrcs extends unknown[]> = UnsafeSource<CombineGlobalSrcExtensions<PluginSrcs> | (CombineNewSourceTypes<PluginSrcs> & CombineGlobalSrcExtensions<PluginSrcs>)>;
105
+
82
106
  /* Excluded from this release type: Component */
83
107
 
84
108
  /* Excluded from this release type: Components */
@@ -86,7 +110,7 @@ CLICK = "click";
86
110
  /**
87
111
  * @public
88
112
  */
89
- declare const Comscore: PluginCtor<Config, Player>;
113
+ declare const Comscore: PluginCtor<NoInfer<Config>, NoInfer<Player>>;
90
114
  export default Comscore;
91
115
 
92
116
  /* Excluded from this release type: CONFIG */
@@ -145,6 +169,10 @@ declare interface Config {
145
169
  */
146
170
  declare type ConfigWith<T> = Config & T;
147
171
 
172
+ declare type ConfigWithSourceExtensions<PluginBareConfigs extends unknown[]> = Omit<ConfigWith<ArrayToIntersection<PluginBareConfigs>>, "src"> & {
173
+ src?: CombineSrc<PickSrcExtensions<PluginBareConfigs>>;
174
+ };
175
+
148
176
  /* Excluded from this release type: CONTENT_REAL_LOAD_START */
149
177
 
150
178
  /**
@@ -388,6 +416,7 @@ declare namespace events {
388
416
  SOURCE,
389
417
  REAP,
390
418
  QUALITIES,
419
+ QUALITY_CHANGE,
391
420
  VIDEO_TRACKS,
392
421
  SET_QUALITY,
393
422
  VIDEO_TRACK_SELECT,
@@ -403,8 +432,20 @@ declare namespace events {
403
432
  }
404
433
  }
405
434
 
435
+ declare type ExtractBareConfig<Plugins extends PluginCtor> = Plugins extends PluginCtor<ConfigWith<infer ConfigType>> ? ConfigType : never;
436
+
437
+ declare type ExtractPluginPlayerExtension<Plugin extends PluginCtor> = Plugin extends PluginCtor<infer _uConfigType, PlayerWith<infer PluginPlayer>> ? PluginPlayer : never;
438
+
406
439
  declare type ExtractPureAPI<T> = T extends PlayerWith<infer PureAPI> ? PureAPI : never;
407
440
 
441
+ declare type ExtractSrcExtension<PluginBareConfig> = Get<PluginBareConfig, "src"> extends UnsafeSource<infer SrcMixinType> ? SrcMixinType : never;
442
+
443
+ declare type FilterNewSourceTypes<PluginSrcs extends unknown[]> = {
444
+ [Index in keyof PluginSrcs]: PluginSrcs[Index] extends {
445
+ type: string;
446
+ } ? PluginSrcs[Index] : never;
447
+ };
448
+
408
449
  /**
409
450
  * @public
410
451
  */
@@ -447,7 +488,7 @@ declare interface FlowplayerUMD extends FlowplayerUMDBase {
447
488
  * Register plugins in flowplayer
448
489
  * @returns flowplayer instance with registered plugins
449
490
  */
450
- <PluginCtors extends PluginCtor[]>(...plugins: PluginCtors): FlowplayerUMDWithPlugins<ConfigWith<MergeConfigs<PluginCtors>>, PlayerWith<MergePlayerAPIExtensions<PluginCtors>>>;
491
+ <PluginCtors extends PluginCtor[]>(...plugins: PluginCtors): FlowplayerUMDWithPlugins<MergeConfigs<PluginCtors>, PlayerWith<MergePlayerExtensions<PluginCtors>>>;
451
492
  }
452
493
 
453
494
  declare interface FlowplayerUMDBase {
@@ -548,6 +589,10 @@ declare const GRABBING = "is-grabbing";
548
589
 
549
590
  declare const HAS_POSTER = "has-poster";
550
591
 
592
+ declare type HasGlobalSrcExtensios<PluginSrcs extends unknown[]> = ArrayToIntersection<PickGlobalSrcExtension<PluginSrcs>>;
593
+
594
+ declare type HasSrcExtensions<PluginBareConfigs extends unknown[]> = TupleToUnion<PickSrcExtensions<PluginBareConfigs>> extends never ? false : true;
595
+
551
596
  declare const HOVERED = "is-hovered";
552
597
 
553
598
  declare const IN_VIEWPORT = "is-in-viewport";
@@ -657,19 +702,24 @@ PluginPlayer extends PlayerWith<_AttachedEventCheck>> extends Plugin_2<PluginOwn
657
702
 
658
703
  declare const LOADING = "is-loading";
659
704
 
660
- declare type MapToConfigs<Arr extends PluginCtor[]> = {
661
- [PluginType in keyof Arr]: Arr[PluginType] extends PluginCtor<ConfigWith<infer ConfigType>> ? ConfigType : never;
705
+ declare type MapToBareConfigs<Plugins extends PluginCtor[]> = {
706
+ [PluginType in keyof Plugins]: ExtractBareConfig<Plugins[PluginType]>;
662
707
  };
663
708
 
664
- declare type MapToPlayerApiExtensions<Arr extends PluginCtor[]> = {
665
- [PluginType in keyof Arr]: Arr[PluginType] extends PluginCtor<infer _uConfigType, PlayerWith<infer PlayerAPIExtension>> ? PlayerAPIExtension : never;
709
+ declare type MapToPlayerExtensions<Plugins extends PluginCtor[]> = {
710
+ [PluginIndex in keyof Plugins]: ExtractPluginPlayerExtension<Plugins[PluginIndex]>;
666
711
  };
667
712
 
668
713
  declare const MENU_OPENED = "has-menu-opened";
669
714
 
670
- declare type MergeConfigs<Arr extends PluginCtor[]> = ArrayToIntersection<MapToConfigs<Arr>>;
715
+ /**
716
+ * Combines plugin config and returns a type derived from Config
717
+ */
718
+ declare type MergeConfigs<Plugins extends PluginCtor[]> = MergePluginConfigs<MapToBareConfigs<Plugins>>;
719
+
720
+ declare type MergePlayerExtensions<Plugins extends PluginCtor[]> = ArrayToIntersection<MapToPlayerExtensions<Plugins>>;
671
721
 
672
- declare type MergePlayerAPIExtensions<Arr extends PluginCtor[]> = ArrayToIntersection<MapToPlayerApiExtensions<Arr>>;
722
+ declare type MergePluginConfigs<PluginBareConfigs extends unknown[]> = HasSrcExtensions<PluginBareConfigs> extends true ? ConfigWithSourceExtensions<PluginBareConfigs> : ConfigWith<ArrayToIntersection<PluginBareConfigs>>;
673
723
 
674
724
  /**
675
725
  * @public
@@ -764,8 +814,6 @@ declare const NO_CONTROLS = "no-controls";
764
814
 
765
815
  declare const NO_DVR = "no-timeline";
766
816
 
767
- declare type NoInfer_2<T> = [T][T extends any ? 0 : never];
768
-
769
817
  /* Excluded from this release type: NON_RECOVERABLE_ERROR */
770
818
 
771
819
  /* Excluded from this release type: NonRecoverableErrorEventDetail */
@@ -784,6 +832,7 @@ declare type OVPMetadata = {
784
832
  category_name?: string;
785
833
  duration?: number;
786
834
  tags?: string;
835
+ playlist_title?: string;
787
836
  };
788
837
 
789
838
  /**
@@ -799,6 +848,26 @@ PAUSE = "pause";
799
848
 
800
849
  declare const PAUSED = "is-paused";
801
850
 
851
+ declare type PickGlobalSrcExtension<PluginSrcs extends unknown[]> = {
852
+ [Index in keyof PluginSrcs]: PluginSrcs[Index] extends {
853
+ type: string;
854
+ } ? unknown : PluginSrcs[Index];
855
+ };
856
+
857
+ /**
858
+ * Maps incoming array to the src extension type
859
+ * @example
860
+ * ```
861
+ * PickSrcExtensions<[
862
+ * {configProp: boolean, src: UnsafeSource<{srcProp: boolean}>},
863
+ * {}
864
+ * ]> // = [{srcProp: boolean}, never]
865
+ * ```
866
+ */
867
+ declare type PickSrcExtensions<PluginBareConfigs extends unknown[]> = {
868
+ [PluginType in keyof PluginBareConfigs]: ExtractSrcExtension<PluginBareConfigs[PluginType]>;
869
+ };
870
+
802
871
  /**
803
872
  * @public
804
873
  */
@@ -920,6 +989,8 @@ declare type PlayerCustomEventsDetailMap = PlayerEmittableCustomEventsDetailMap
920
989
  [DVR]: DvrEventDetail;
921
990
  [RETRY]: RetryEventDetail;
922
991
  [RECOVER]: RecoverEventDetail;
992
+ [QUALITIES]: QualitiesEventDetail;
993
+ [QUALITY_CHANGE]: QualityChangeEventDetail;
923
994
  /* Excluded from this release type: audioonlysource */
924
995
  /* Excluded from this release type: renderplugin */
925
996
  /* Excluded from this release type: "seek:queued" */
@@ -976,7 +1047,10 @@ declare type PlayerCustomEventsOverloads = {
976
1047
  * Emitted when the set of underlying qualities has changed.
977
1048
  */
978
1049
  on(event: typeof QUALITIES, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof QUALITIES]>) => void): Player;
979
- /* Excluded from this release type: on */
1050
+ /**
1051
+ * Emitted when the media changes quality.
1052
+ */
1053
+ on(event: typeof QUALITY_CHANGE, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof QUALITY_CHANGE]>) => void): Player;
980
1054
  /* Excluded from this release type: on */
981
1055
  /**
982
1056
  * Listen to this event to create a recommendations grid using the data passed with the event.
@@ -1031,7 +1105,6 @@ declare type PlayerCustomEventsOverloads = {
1031
1105
  /* Excluded from this release type: emit */
1032
1106
  /* Excluded from this release type: emit */
1033
1107
  /* Excluded from this release type: emit */
1034
- /* Excluded from this release type: emit */
1035
1108
  };
1036
1109
 
1037
1110
  declare type PlayerEmittableCustomEventsDetailMap = {
@@ -1039,7 +1112,6 @@ declare type PlayerEmittableCustomEventsDetailMap = {
1039
1112
  [CONTEXT_MENU]: ContextMenuEventDetail;
1040
1113
  [VIEW_ENTER]: ViewEnterEventDetail;
1041
1114
  [VIEW_LEAVE]: ViewLeaveEventDetail;
1042
- [QUALITIES]: QualitiesEventDetail;
1043
1115
  [RECOMMENDATIONS_READY]: RecommendationsReadyEventDetail;
1044
1116
  };
1045
1117
 
@@ -1141,11 +1213,16 @@ PROGRESS = "progress";
1141
1213
  /**
1142
1214
  * @public
1143
1215
  */
1144
- declare type QselOption = {
1145
- height: number;
1216
+ declare type QselOption = (Level & {
1146
1217
  level: number;
1147
- text: string;
1148
- /* Excluded from this release type: videoCodec */
1218
+ }) | BitrateInfo | {
1219
+ name: string | number;
1220
+ encodingId: string;
1221
+ spatialLayerId: number;
1222
+ temporalLayerId: number;
1223
+ maxSpatialLayerId: number;
1224
+ maxTemporalLayerId: number;
1225
+ height: number;
1149
1226
  width: number;
1150
1227
  };
1151
1228
 
@@ -1169,9 +1246,29 @@ QUALITIES = "qualities";
1169
1246
  */
1170
1247
  declare type QualitiesEventDetail = QselOption[];
1171
1248
 
1172
- /* Excluded from this release type: _QualitiesEventDetail */
1249
+ /**
1250
+ * @public
1251
+ * emitted whenever the media changes quality
1252
+ */
1253
+ declare const /**
1254
+ @public
1255
+ * when a new player is inserted into the HTML
1256
+ */ /**
1257
+ * @public
1258
+ * emitted whenever the media changes quality
1259
+ */
1260
+ QUALITY_CHANGE = "qualitychange";
1173
1261
 
1174
- /* Excluded from this release type: _QualityDetail */
1262
+ /**
1263
+ * @public
1264
+ */
1265
+ declare type QualityChangeEventDetail = {
1266
+ before: Level | BitrateInfo;
1267
+ after: Level | BitrateInfo;
1268
+ plugin: string;
1269
+ automatic: boolean;
1270
+ downscale: boolean;
1271
+ };
1175
1272
 
1176
1273
  declare enum QualityOpts {
1177
1274
  LOW = 1,
@@ -1377,14 +1474,14 @@ declare type SourceEventDetail = SourceObj;
1377
1474
  /**
1378
1475
  * @public
1379
1476
  */
1380
- declare type SourceObj = {
1477
+ declare type SourceObj<T = unknown> = {
1381
1478
  src?: SourceStr;
1382
1479
  /**
1383
1480
  * the MIME type (example `video/mp4` or `application/x-mpegurl`)
1384
1481
  */
1385
1482
  type?: string;
1386
1483
  drm?: DRMSourceConfiguration;
1387
- };
1484
+ } & T;
1388
1485
 
1389
1486
  /**
1390
1487
  * @public
@@ -1511,7 +1608,7 @@ declare const TV = "is-tv";
1511
1608
  /**
1512
1609
  * @public
1513
1610
  */
1514
- declare type UnsafeSource = SourceStr | SourceObj | Array<SourceStr | SourceObj>;
1611
+ declare type UnsafeSource<SrcMixin = unknown> = SourceStr | SourceObj<SrcMixin> | Array<SourceStr | SourceObj<SrcMixin>>;
1515
1612
 
1516
1613
  /**
1517
1614
  * @public
@@ -1607,9 +1704,6 @@ declare const WILL_PLAY = "will-play";
1607
1704
 
1608
1705
  declare const WILL_SEEK = "will-seek";
1609
1706
 
1610
- declare type WithOpts<PluginPlayer extends Player = Player, PluginConfig extends Config = Config> = PluginPlayer & {
1611
- opts: PluginConfig;
1612
- setOpts(config: PluginConfig): void;
1613
- };
1707
+ declare type WithOpts<PluginPlayer extends Player = Player, PluginConfig extends Config = Config> = SetFieldType<SetFieldType<PluginPlayer, "opts", PluginConfig>, "setOpts", (config: PluginConfig) => void>;
1614
1708
 
1615
1709
  export { }
@@ -1,7 +1,11 @@
1
1
  /// <reference types="node" />
2
2
 
3
3
  import type { BitrateInfo } from 'dashjs';
4
+ import type { Get } from 'type-fest';
5
+ import type { Level } from 'hls.js';
4
6
  import type { MediaKeyFunc } from 'hls.js';
7
+ import type { SetFieldType } from 'type-fest';
8
+ import type { TupleToUnion } from 'type-fest';
5
9
 
6
10
  /* Excluded from this release type: AnyLoader */
7
11
 
@@ -79,6 +83,26 @@ declare const /**
79
83
  */
80
84
  CLICK = "click";
81
85
 
86
+ /**
87
+ * For plugins that add new properties to all source types, combine their src-mixins into one SourceObject
88
+ * @example
89
+ * ```
90
+ * type Combined = CombineGlobalSrcExtensions<DRMPlugin, PluginWithFooFieldInSrc> // Combined = SourceObject<DRMConfig & FooFieldConfig>
91
+ * ```
92
+ */
93
+ declare type CombineGlobalSrcExtensions<PluginSrcs extends unknown[]> = HasGlobalSrcExtensios<PluginSrcs> extends false ? SourceObj : SourceObj & ArrayToIntersection<PickGlobalSrcExtension<PluginSrcs>>;
94
+
95
+ /**
96
+ * For plugins that define a new src type, make a union of all new src.type declarations
97
+ * @example
98
+ * ```
99
+ * type Combined = CombineNewSourceTypes<RTSPlugin, SSAIPlugin> // Combined = DRMConfig | FooFieldConfig
100
+ * ```
101
+ */
102
+ declare type CombineNewSourceTypes<PluginSrcs extends unknown[]> = TupleToUnion<FilterNewSourceTypes<PluginSrcs>>;
103
+
104
+ declare type CombineSrc<PluginSrcs extends unknown[]> = UnsafeSource<CombineGlobalSrcExtensions<PluginSrcs> | (CombineNewSourceTypes<PluginSrcs> & CombineGlobalSrcExtensions<PluginSrcs>)>;
105
+
82
106
  /* Excluded from this release type: Component */
83
107
 
84
108
  /* Excluded from this release type: Components */
@@ -139,12 +163,16 @@ declare interface Config {
139
163
  */
140
164
  declare type ConfigWith<T> = Config & T;
141
165
 
166
+ declare type ConfigWithSourceExtensions<PluginBareConfigs extends unknown[]> = Omit<ConfigWith<ArrayToIntersection<PluginBareConfigs>>, "src"> & {
167
+ src?: CombineSrc<PickSrcExtensions<PluginBareConfigs>>;
168
+ };
169
+
142
170
  /**
143
171
  * @public
144
172
  * With the Consent plugin, it's possible to tell the player whether it's allowed to send analytics and store data to browser by the player.
145
173
  * See {@link https://developer.wowza.com/docs/wowza-flowplayer/plugins/consent/ | Official documentation}
146
174
  */
147
- declare const Consent: PluginCtor<ConsentConfig, Player> & ConsentAPI;
175
+ declare const Consent: PluginCtor<NoInfer<ConsentConfig>, NoInfer<Player>> & NoInfer<ConsentAPI>;
148
176
  export default Consent;
149
177
 
150
178
  /**
@@ -414,6 +442,7 @@ declare namespace events {
414
442
  SOURCE,
415
443
  REAP,
416
444
  QUALITIES,
445
+ QUALITY_CHANGE,
417
446
  VIDEO_TRACKS,
418
447
  SET_QUALITY,
419
448
  VIDEO_TRACK_SELECT,
@@ -429,8 +458,20 @@ declare namespace events {
429
458
  }
430
459
  }
431
460
 
461
+ declare type ExtractBareConfig<Plugins extends PluginCtor> = Plugins extends PluginCtor<ConfigWith<infer ConfigType>> ? ConfigType : never;
462
+
463
+ declare type ExtractPluginPlayerExtension<Plugin extends PluginCtor> = Plugin extends PluginCtor<infer _uConfigType, PlayerWith<infer PluginPlayer>> ? PluginPlayer : never;
464
+
432
465
  declare type ExtractPureAPI<T> = T extends PlayerWith<infer PureAPI> ? PureAPI : never;
433
466
 
467
+ declare type ExtractSrcExtension<PluginBareConfig> = Get<PluginBareConfig, "src"> extends UnsafeSource<infer SrcMixinType> ? SrcMixinType : never;
468
+
469
+ declare type FilterNewSourceTypes<PluginSrcs extends unknown[]> = {
470
+ [Index in keyof PluginSrcs]: PluginSrcs[Index] extends {
471
+ type: string;
472
+ } ? PluginSrcs[Index] : never;
473
+ };
474
+
434
475
  /**
435
476
  * @public
436
477
  */
@@ -473,7 +514,7 @@ declare interface FlowplayerUMD extends FlowplayerUMDBase {
473
514
  * Register plugins in flowplayer
474
515
  * @returns flowplayer instance with registered plugins
475
516
  */
476
- <PluginCtors extends PluginCtor[]>(...plugins: PluginCtors): FlowplayerUMDWithPlugins<ConfigWith<MergeConfigs<PluginCtors>>, PlayerWith<MergePlayerAPIExtensions<PluginCtors>>>;
517
+ <PluginCtors extends PluginCtor[]>(...plugins: PluginCtors): FlowplayerUMDWithPlugins<MergeConfigs<PluginCtors>, PlayerWith<MergePlayerExtensions<PluginCtors>>>;
477
518
  }
478
519
 
479
520
  declare interface FlowplayerUMDBase {
@@ -574,6 +615,10 @@ declare const GRABBING = "is-grabbing";
574
615
 
575
616
  declare const HAS_POSTER = "has-poster";
576
617
 
618
+ declare type HasGlobalSrcExtensios<PluginSrcs extends unknown[]> = ArrayToIntersection<PickGlobalSrcExtension<PluginSrcs>>;
619
+
620
+ declare type HasSrcExtensions<PluginBareConfigs extends unknown[]> = TupleToUnion<PickSrcExtensions<PluginBareConfigs>> extends never ? false : true;
621
+
577
622
  declare const HOVERED = "is-hovered";
578
623
 
579
624
  declare const IN_VIEWPORT = "is-in-viewport";
@@ -683,19 +728,24 @@ PluginPlayer extends PlayerWith<_AttachedEventCheck>> extends Plugin_2<PluginOwn
683
728
 
684
729
  declare const LOADING = "is-loading";
685
730
 
686
- declare type MapToConfigs<Arr extends PluginCtor[]> = {
687
- [PluginType in keyof Arr]: Arr[PluginType] extends PluginCtor<ConfigWith<infer ConfigType>> ? ConfigType : never;
731
+ declare type MapToBareConfigs<Plugins extends PluginCtor[]> = {
732
+ [PluginType in keyof Plugins]: ExtractBareConfig<Plugins[PluginType]>;
688
733
  };
689
734
 
690
- declare type MapToPlayerApiExtensions<Arr extends PluginCtor[]> = {
691
- [PluginType in keyof Arr]: Arr[PluginType] extends PluginCtor<infer _uConfigType, PlayerWith<infer PlayerAPIExtension>> ? PlayerAPIExtension : never;
735
+ declare type MapToPlayerExtensions<Plugins extends PluginCtor[]> = {
736
+ [PluginIndex in keyof Plugins]: ExtractPluginPlayerExtension<Plugins[PluginIndex]>;
692
737
  };
693
738
 
694
739
  declare const MENU_OPENED = "has-menu-opened";
695
740
 
696
- declare type MergeConfigs<Arr extends PluginCtor[]> = ArrayToIntersection<MapToConfigs<Arr>>;
741
+ /**
742
+ * Combines plugin config and returns a type derived from Config
743
+ */
744
+ declare type MergeConfigs<Plugins extends PluginCtor[]> = MergePluginConfigs<MapToBareConfigs<Plugins>>;
745
+
746
+ declare type MergePlayerExtensions<Plugins extends PluginCtor[]> = ArrayToIntersection<MapToPlayerExtensions<Plugins>>;
697
747
 
698
- declare type MergePlayerAPIExtensions<Arr extends PluginCtor[]> = ArrayToIntersection<MapToPlayerApiExtensions<Arr>>;
748
+ declare type MergePluginConfigs<PluginBareConfigs extends unknown[]> = HasSrcExtensions<PluginBareConfigs> extends true ? ConfigWithSourceExtensions<PluginBareConfigs> : ConfigWith<ArrayToIntersection<PluginBareConfigs>>;
699
749
 
700
750
  /**
701
751
  * @public
@@ -790,8 +840,6 @@ declare const NO_CONTROLS = "no-controls";
790
840
 
791
841
  declare const NO_DVR = "no-timeline";
792
842
 
793
- declare type NoInfer_2<T> = [T][T extends any ? 0 : never];
794
-
795
843
  /* Excluded from this release type: NON_RECOVERABLE_ERROR */
796
844
 
797
845
  /* Excluded from this release type: NonRecoverableErrorEventDetail */
@@ -810,6 +858,7 @@ declare type OVPMetadata = {
810
858
  category_name?: string;
811
859
  duration?: number;
812
860
  tags?: string;
861
+ playlist_title?: string;
813
862
  };
814
863
 
815
864
  /**
@@ -825,6 +874,26 @@ PAUSE = "pause";
825
874
 
826
875
  declare const PAUSED = "is-paused";
827
876
 
877
+ declare type PickGlobalSrcExtension<PluginSrcs extends unknown[]> = {
878
+ [Index in keyof PluginSrcs]: PluginSrcs[Index] extends {
879
+ type: string;
880
+ } ? unknown : PluginSrcs[Index];
881
+ };
882
+
883
+ /**
884
+ * Maps incoming array to the src extension type
885
+ * @example
886
+ * ```
887
+ * PickSrcExtensions<[
888
+ * {configProp: boolean, src: UnsafeSource<{srcProp: boolean}>},
889
+ * {}
890
+ * ]> // = [{srcProp: boolean}, never]
891
+ * ```
892
+ */
893
+ declare type PickSrcExtensions<PluginBareConfigs extends unknown[]> = {
894
+ [PluginType in keyof PluginBareConfigs]: ExtractSrcExtension<PluginBareConfigs[PluginType]>;
895
+ };
896
+
828
897
  /**
829
898
  * @public
830
899
  */
@@ -946,6 +1015,8 @@ declare type PlayerCustomEventsDetailMap = PlayerEmittableCustomEventsDetailMap
946
1015
  [DVR]: DvrEventDetail;
947
1016
  [RETRY]: RetryEventDetail;
948
1017
  [RECOVER]: RecoverEventDetail;
1018
+ [QUALITIES]: QualitiesEventDetail;
1019
+ [QUALITY_CHANGE]: QualityChangeEventDetail;
949
1020
  /* Excluded from this release type: audioonlysource */
950
1021
  /* Excluded from this release type: renderplugin */
951
1022
  /* Excluded from this release type: "seek:queued" */
@@ -1002,7 +1073,10 @@ declare type PlayerCustomEventsOverloads = {
1002
1073
  * Emitted when the set of underlying qualities has changed.
1003
1074
  */
1004
1075
  on(event: typeof QUALITIES, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof QUALITIES]>) => void): Player;
1005
- /* Excluded from this release type: on */
1076
+ /**
1077
+ * Emitted when the media changes quality.
1078
+ */
1079
+ on(event: typeof QUALITY_CHANGE, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof QUALITY_CHANGE]>) => void): Player;
1006
1080
  /* Excluded from this release type: on */
1007
1081
  /**
1008
1082
  * Listen to this event to create a recommendations grid using the data passed with the event.
@@ -1057,7 +1131,6 @@ declare type PlayerCustomEventsOverloads = {
1057
1131
  /* Excluded from this release type: emit */
1058
1132
  /* Excluded from this release type: emit */
1059
1133
  /* Excluded from this release type: emit */
1060
- /* Excluded from this release type: emit */
1061
1134
  };
1062
1135
 
1063
1136
  declare type PlayerEmittableCustomEventsDetailMap = {
@@ -1065,7 +1138,6 @@ declare type PlayerEmittableCustomEventsDetailMap = {
1065
1138
  [CONTEXT_MENU]: ContextMenuEventDetail;
1066
1139
  [VIEW_ENTER]: ViewEnterEventDetail;
1067
1140
  [VIEW_LEAVE]: ViewLeaveEventDetail;
1068
- [QUALITIES]: QualitiesEventDetail;
1069
1141
  [RECOMMENDATIONS_READY]: RecommendationsReadyEventDetail;
1070
1142
  };
1071
1143
 
@@ -1167,11 +1239,16 @@ PROGRESS = "progress";
1167
1239
  /**
1168
1240
  * @public
1169
1241
  */
1170
- declare type QselOption = {
1171
- height: number;
1242
+ declare type QselOption = (Level & {
1172
1243
  level: number;
1173
- text: string;
1174
- /* Excluded from this release type: videoCodec */
1244
+ }) | BitrateInfo | {
1245
+ name: string | number;
1246
+ encodingId: string;
1247
+ spatialLayerId: number;
1248
+ temporalLayerId: number;
1249
+ maxSpatialLayerId: number;
1250
+ maxTemporalLayerId: number;
1251
+ height: number;
1175
1252
  width: number;
1176
1253
  };
1177
1254
 
@@ -1195,9 +1272,29 @@ QUALITIES = "qualities";
1195
1272
  */
1196
1273
  declare type QualitiesEventDetail = QselOption[];
1197
1274
 
1198
- /* Excluded from this release type: _QualitiesEventDetail */
1275
+ /**
1276
+ * @public
1277
+ * emitted whenever the media changes quality
1278
+ */
1279
+ declare const /**
1280
+ @public
1281
+ * when a new player is inserted into the HTML
1282
+ */ /**
1283
+ * @public
1284
+ * emitted whenever the media changes quality
1285
+ */
1286
+ QUALITY_CHANGE = "qualitychange";
1199
1287
 
1200
- /* Excluded from this release type: _QualityDetail */
1288
+ /**
1289
+ * @public
1290
+ */
1291
+ declare type QualityChangeEventDetail = {
1292
+ before: Level | BitrateInfo;
1293
+ after: Level | BitrateInfo;
1294
+ plugin: string;
1295
+ automatic: boolean;
1296
+ downscale: boolean;
1297
+ };
1201
1298
 
1202
1299
  declare enum QualityOpts {
1203
1300
  LOW = 1,
@@ -1403,14 +1500,14 @@ declare type SourceEventDetail = SourceObj;
1403
1500
  /**
1404
1501
  * @public
1405
1502
  */
1406
- declare type SourceObj = {
1503
+ declare type SourceObj<T = unknown> = {
1407
1504
  src?: SourceStr;
1408
1505
  /**
1409
1506
  * the MIME type (example `video/mp4` or `application/x-mpegurl`)
1410
1507
  */
1411
1508
  type?: string;
1412
1509
  drm?: DRMSourceConfiguration;
1413
- };
1510
+ } & T;
1414
1511
 
1415
1512
  /**
1416
1513
  * @public
@@ -1559,7 +1656,7 @@ declare const TV = "is-tv";
1559
1656
  /**
1560
1657
  * @public
1561
1658
  */
1562
- declare type UnsafeSource = SourceStr | SourceObj | Array<SourceStr | SourceObj>;
1659
+ declare type UnsafeSource<SrcMixin = unknown> = SourceStr | SourceObj<SrcMixin> | Array<SourceStr | SourceObj<SrcMixin>>;
1563
1660
 
1564
1661
  /**
1565
1662
  * @public
@@ -1655,9 +1752,6 @@ declare const WILL_PLAY = "will-play";
1655
1752
 
1656
1753
  declare const WILL_SEEK = "will-seek";
1657
1754
 
1658
- declare type WithOpts<PluginPlayer extends Player = Player, PluginConfig extends Config = Config> = PluginPlayer & {
1659
- opts: PluginConfig;
1660
- setOpts(config: PluginConfig): void;
1661
- };
1755
+ declare type WithOpts<PluginPlayer extends Player = Player, PluginConfig extends Config = Config> = SetFieldType<SetFieldType<PluginPlayer, "opts", PluginConfig>, "setOpts", (config: PluginConfig) => void>;
1662
1756
 
1663
1757
  export { }