@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
package/plugins/qul.d.ts CHANGED
@@ -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,6 +163,10 @@ 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
  /* Excluded from this release type: CONTENT_REAL_LOAD_START */
143
171
 
144
172
  /**
@@ -382,6 +410,7 @@ declare namespace events {
382
410
  SOURCE,
383
411
  REAP,
384
412
  QUALITIES,
413
+ QUALITY_CHANGE,
385
414
  VIDEO_TRACKS,
386
415
  SET_QUALITY,
387
416
  VIDEO_TRACK_SELECT,
@@ -397,8 +426,20 @@ declare namespace events {
397
426
  }
398
427
  }
399
428
 
429
+ declare type ExtractBareConfig<Plugins extends PluginCtor> = Plugins extends PluginCtor<ConfigWith<infer ConfigType>> ? ConfigType : never;
430
+
431
+ declare type ExtractPluginPlayerExtension<Plugin extends PluginCtor> = Plugin extends PluginCtor<infer _uConfigType, PlayerWith<infer PluginPlayer>> ? PluginPlayer : never;
432
+
400
433
  declare type ExtractPureAPI<T> = T extends PlayerWith<infer PureAPI> ? PureAPI : never;
401
434
 
435
+ declare type ExtractSrcExtension<PluginBareConfig> = Get<PluginBareConfig, "src"> extends UnsafeSource<infer SrcMixinType> ? SrcMixinType : never;
436
+
437
+ declare type FilterNewSourceTypes<PluginSrcs extends unknown[]> = {
438
+ [Index in keyof PluginSrcs]: PluginSrcs[Index] extends {
439
+ type: string;
440
+ } ? PluginSrcs[Index] : never;
441
+ };
442
+
402
443
  /**
403
444
  * @public
404
445
  */
@@ -441,7 +482,7 @@ declare interface FlowplayerUMD extends FlowplayerUMDBase {
441
482
  * Register plugins in flowplayer
442
483
  * @returns flowplayer instance with registered plugins
443
484
  */
444
- <PluginCtors extends PluginCtor[]>(...plugins: PluginCtors): FlowplayerUMDWithPlugins<ConfigWith<MergeConfigs<PluginCtors>>, PlayerWith<MergePlayerAPIExtensions<PluginCtors>>>;
485
+ <PluginCtors extends PluginCtor[]>(...plugins: PluginCtors): FlowplayerUMDWithPlugins<MergeConfigs<PluginCtors>, PlayerWith<MergePlayerExtensions<PluginCtors>>>;
445
486
  }
446
487
 
447
488
  declare interface FlowplayerUMDBase {
@@ -542,6 +583,10 @@ declare const GRABBING = "is-grabbing";
542
583
 
543
584
  declare const HAS_POSTER = "has-poster";
544
585
 
586
+ declare type HasGlobalSrcExtensios<PluginSrcs extends unknown[]> = ArrayToIntersection<PickGlobalSrcExtension<PluginSrcs>>;
587
+
588
+ declare type HasSrcExtensions<PluginBareConfigs extends unknown[]> = TupleToUnion<PickSrcExtensions<PluginBareConfigs>> extends never ? false : true;
589
+
545
590
  declare const HOVERED = "is-hovered";
546
591
 
547
592
  declare const IN_VIEWPORT = "is-in-viewport";
@@ -651,19 +696,24 @@ PluginPlayer extends PlayerWith<_AttachedEventCheck>> extends Plugin_2<PluginOwn
651
696
 
652
697
  declare const LOADING = "is-loading";
653
698
 
654
- declare type MapToConfigs<Arr extends PluginCtor[]> = {
655
- [PluginType in keyof Arr]: Arr[PluginType] extends PluginCtor<ConfigWith<infer ConfigType>> ? ConfigType : never;
699
+ declare type MapToBareConfigs<Plugins extends PluginCtor[]> = {
700
+ [PluginType in keyof Plugins]: ExtractBareConfig<Plugins[PluginType]>;
656
701
  };
657
702
 
658
- declare type MapToPlayerApiExtensions<Arr extends PluginCtor[]> = {
659
- [PluginType in keyof Arr]: Arr[PluginType] extends PluginCtor<infer _uConfigType, PlayerWith<infer PlayerAPIExtension>> ? PlayerAPIExtension : never;
703
+ declare type MapToPlayerExtensions<Plugins extends PluginCtor[]> = {
704
+ [PluginIndex in keyof Plugins]: ExtractPluginPlayerExtension<Plugins[PluginIndex]>;
660
705
  };
661
706
 
662
707
  declare const MENU_OPENED = "has-menu-opened";
663
708
 
664
- declare type MergeConfigs<Arr extends PluginCtor[]> = ArrayToIntersection<MapToConfigs<Arr>>;
709
+ /**
710
+ * Combines plugin config and returns a type derived from Config
711
+ */
712
+ declare type MergeConfigs<Plugins extends PluginCtor[]> = MergePluginConfigs<MapToBareConfigs<Plugins>>;
713
+
714
+ declare type MergePlayerExtensions<Plugins extends PluginCtor[]> = ArrayToIntersection<MapToPlayerExtensions<Plugins>>;
665
715
 
666
- declare type MergePlayerAPIExtensions<Arr extends PluginCtor[]> = ArrayToIntersection<MapToPlayerApiExtensions<Arr>>;
716
+ declare type MergePluginConfigs<PluginBareConfigs extends unknown[]> = HasSrcExtensions<PluginBareConfigs> extends true ? ConfigWithSourceExtensions<PluginBareConfigs> : ConfigWith<ArrayToIntersection<PluginBareConfigs>>;
667
717
 
668
718
  /**
669
719
  * @public
@@ -758,8 +808,6 @@ declare const NO_CONTROLS = "no-controls";
758
808
 
759
809
  declare const NO_DVR = "no-timeline";
760
810
 
761
- declare type NoInfer_2<T> = [T][T extends any ? 0 : never];
762
-
763
811
  /* Excluded from this release type: NON_RECOVERABLE_ERROR */
764
812
 
765
813
  /* Excluded from this release type: NonRecoverableErrorEventDetail */
@@ -778,6 +826,7 @@ declare type OVPMetadata = {
778
826
  category_name?: string;
779
827
  duration?: number;
780
828
  tags?: string;
829
+ playlist_title?: string;
781
830
  };
782
831
 
783
832
  /**
@@ -793,6 +842,26 @@ PAUSE = "pause";
793
842
 
794
843
  declare const PAUSED = "is-paused";
795
844
 
845
+ declare type PickGlobalSrcExtension<PluginSrcs extends unknown[]> = {
846
+ [Index in keyof PluginSrcs]: PluginSrcs[Index] extends {
847
+ type: string;
848
+ } ? unknown : PluginSrcs[Index];
849
+ };
850
+
851
+ /**
852
+ * Maps incoming array to the src extension type
853
+ * @example
854
+ * ```
855
+ * PickSrcExtensions<[
856
+ * {configProp: boolean, src: UnsafeSource<{srcProp: boolean}>},
857
+ * {}
858
+ * ]> // = [{srcProp: boolean}, never]
859
+ * ```
860
+ */
861
+ declare type PickSrcExtensions<PluginBareConfigs extends unknown[]> = {
862
+ [PluginType in keyof PluginBareConfigs]: ExtractSrcExtension<PluginBareConfigs[PluginType]>;
863
+ };
864
+
796
865
  /**
797
866
  * @public
798
867
  */
@@ -914,6 +983,8 @@ declare type PlayerCustomEventsDetailMap = PlayerEmittableCustomEventsDetailMap
914
983
  [DVR]: DvrEventDetail;
915
984
  [RETRY]: RetryEventDetail;
916
985
  [RECOVER]: RecoverEventDetail;
986
+ [QUALITIES]: QualitiesEventDetail;
987
+ [QUALITY_CHANGE]: QualityChangeEventDetail;
917
988
  /* Excluded from this release type: audioonlysource */
918
989
  /* Excluded from this release type: renderplugin */
919
990
  /* Excluded from this release type: "seek:queued" */
@@ -970,7 +1041,10 @@ declare type PlayerCustomEventsOverloads = {
970
1041
  * Emitted when the set of underlying qualities has changed.
971
1042
  */
972
1043
  on(event: typeof QUALITIES, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof QUALITIES]>) => void): Player;
973
- /* Excluded from this release type: on */
1044
+ /**
1045
+ * Emitted when the media changes quality.
1046
+ */
1047
+ on(event: typeof QUALITY_CHANGE, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof QUALITY_CHANGE]>) => void): Player;
974
1048
  /* Excluded from this release type: on */
975
1049
  /**
976
1050
  * Listen to this event to create a recommendations grid using the data passed with the event.
@@ -1025,7 +1099,6 @@ declare type PlayerCustomEventsOverloads = {
1025
1099
  /* Excluded from this release type: emit */
1026
1100
  /* Excluded from this release type: emit */
1027
1101
  /* Excluded from this release type: emit */
1028
- /* Excluded from this release type: emit */
1029
1102
  };
1030
1103
 
1031
1104
  declare type PlayerEmittableCustomEventsDetailMap = {
@@ -1033,7 +1106,6 @@ declare type PlayerEmittableCustomEventsDetailMap = {
1033
1106
  [CONTEXT_MENU]: ContextMenuEventDetail;
1034
1107
  [VIEW_ENTER]: ViewEnterEventDetail;
1035
1108
  [VIEW_LEAVE]: ViewLeaveEventDetail;
1036
- [QUALITIES]: QualitiesEventDetail;
1037
1109
  [RECOMMENDATIONS_READY]: RecommendationsReadyEventDetail;
1038
1110
  };
1039
1111
 
@@ -1135,11 +1207,16 @@ PROGRESS = "progress";
1135
1207
  /**
1136
1208
  * @public
1137
1209
  */
1138
- declare type QselOption = {
1139
- height: number;
1210
+ declare type QselOption = (Level & {
1140
1211
  level: number;
1141
- text: string;
1142
- /* Excluded from this release type: videoCodec */
1212
+ }) | BitrateInfo | {
1213
+ name: string | number;
1214
+ encodingId: string;
1215
+ spatialLayerId: number;
1216
+ temporalLayerId: number;
1217
+ maxSpatialLayerId: number;
1218
+ maxTemporalLayerId: number;
1219
+ height: number;
1143
1220
  width: number;
1144
1221
  };
1145
1222
 
@@ -1163,9 +1240,29 @@ QUALITIES = "qualities";
1163
1240
  */
1164
1241
  declare type QualitiesEventDetail = QselOption[];
1165
1242
 
1166
- /* Excluded from this release type: _QualitiesEventDetail */
1243
+ /**
1244
+ * @public
1245
+ * emitted whenever the media changes quality
1246
+ */
1247
+ declare const /**
1248
+ @public
1249
+ * when a new player is inserted into the HTML
1250
+ */ /**
1251
+ * @public
1252
+ * emitted whenever the media changes quality
1253
+ */
1254
+ QUALITY_CHANGE = "qualitychange";
1167
1255
 
1168
- /* Excluded from this release type: _QualityDetail */
1256
+ /**
1257
+ * @public
1258
+ */
1259
+ declare type QualityChangeEventDetail = {
1260
+ before: Level | BitrateInfo;
1261
+ after: Level | BitrateInfo;
1262
+ plugin: string;
1263
+ automatic: boolean;
1264
+ downscale: boolean;
1265
+ };
1169
1266
 
1170
1267
  declare enum QualityOpts {
1171
1268
  LOW = 1,
@@ -1176,7 +1273,7 @@ declare enum QualityOpts {
1176
1273
  /**
1177
1274
  * @public
1178
1275
  */
1179
- declare const QUL: PluginCtor<QULConfig, Player>;
1276
+ declare const QUL: PluginCtor<NoInfer<QULConfig>, NoInfer<Player>>;
1180
1277
  export default QUL;
1181
1278
 
1182
1279
  /**
@@ -1392,14 +1489,14 @@ declare type SourceEventDetail = SourceObj;
1392
1489
  /**
1393
1490
  * @public
1394
1491
  */
1395
- declare type SourceObj = {
1492
+ declare type SourceObj<T = unknown> = {
1396
1493
  src?: SourceStr;
1397
1494
  /**
1398
1495
  * the MIME type (example `video/mp4` or `application/x-mpegurl`)
1399
1496
  */
1400
1497
  type?: string;
1401
1498
  drm?: DRMSourceConfiguration;
1402
- };
1499
+ } & T;
1403
1500
 
1404
1501
  /**
1405
1502
  * @public
@@ -1526,7 +1623,7 @@ declare const TV = "is-tv";
1526
1623
  /**
1527
1624
  * @public
1528
1625
  */
1529
- declare type UnsafeSource = SourceStr | SourceObj | Array<SourceStr | SourceObj>;
1626
+ declare type UnsafeSource<SrcMixin = unknown> = SourceStr | SourceObj<SrcMixin> | Array<SourceStr | SourceObj<SrcMixin>>;
1530
1627
 
1531
1628
  /**
1532
1629
  * @public
@@ -1622,9 +1719,6 @@ declare const WILL_PLAY = "will-play";
1622
1719
 
1623
1720
  declare const WILL_SEEK = "will-seek";
1624
1721
 
1625
- declare type WithOpts<PluginPlayer extends Player = Player, PluginConfig extends Config = Config> = PluginPlayer & {
1626
- opts: PluginConfig;
1627
- setOpts(config: PluginConfig): void;
1628
- };
1722
+ declare type WithOpts<PluginPlayer extends Player = Player, PluginConfig extends Config = Config> = SetFieldType<SetFieldType<PluginPlayer, "opts", PluginConfig>, "setOpts", (config: PluginConfig) => void>;
1629
1723
 
1630
1724
  export { }
package/plugins/rts.d.ts CHANGED
@@ -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,6 +163,10 @@ 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
  /* Excluded from this release type: CONTENT_REAL_LOAD_START */
143
171
 
144
172
  /**
@@ -382,6 +410,7 @@ declare namespace events {
382
410
  SOURCE,
383
411
  REAP,
384
412
  QUALITIES,
413
+ QUALITY_CHANGE,
385
414
  VIDEO_TRACKS,
386
415
  SET_QUALITY,
387
416
  VIDEO_TRACK_SELECT,
@@ -397,8 +426,20 @@ declare namespace events {
397
426
  }
398
427
  }
399
428
 
429
+ declare type ExtractBareConfig<Plugins extends PluginCtor> = Plugins extends PluginCtor<ConfigWith<infer ConfigType>> ? ConfigType : never;
430
+
431
+ declare type ExtractPluginPlayerExtension<Plugin extends PluginCtor> = Plugin extends PluginCtor<infer _uConfigType, PlayerWith<infer PluginPlayer>> ? PluginPlayer : never;
432
+
400
433
  declare type ExtractPureAPI<T> = T extends PlayerWith<infer PureAPI> ? PureAPI : never;
401
434
 
435
+ declare type ExtractSrcExtension<PluginBareConfig> = Get<PluginBareConfig, "src"> extends UnsafeSource<infer SrcMixinType> ? SrcMixinType : never;
436
+
437
+ declare type FilterNewSourceTypes<PluginSrcs extends unknown[]> = {
438
+ [Index in keyof PluginSrcs]: PluginSrcs[Index] extends {
439
+ type: string;
440
+ } ? PluginSrcs[Index] : never;
441
+ };
442
+
402
443
  /**
403
444
  * @public
404
445
  */
@@ -441,7 +482,7 @@ declare interface FlowplayerUMD extends FlowplayerUMDBase {
441
482
  * Register plugins in flowplayer
442
483
  * @returns flowplayer instance with registered plugins
443
484
  */
444
- <PluginCtors extends PluginCtor[]>(...plugins: PluginCtors): FlowplayerUMDWithPlugins<ConfigWith<MergeConfigs<PluginCtors>>, PlayerWith<MergePlayerAPIExtensions<PluginCtors>>>;
485
+ <PluginCtors extends PluginCtor[]>(...plugins: PluginCtors): FlowplayerUMDWithPlugins<MergeConfigs<PluginCtors>, PlayerWith<MergePlayerExtensions<PluginCtors>>>;
445
486
  }
446
487
 
447
488
  declare interface FlowplayerUMDBase {
@@ -542,6 +583,10 @@ declare const GRABBING = "is-grabbing";
542
583
 
543
584
  declare const HAS_POSTER = "has-poster";
544
585
 
586
+ declare type HasGlobalSrcExtensios<PluginSrcs extends unknown[]> = ArrayToIntersection<PickGlobalSrcExtension<PluginSrcs>>;
587
+
588
+ declare type HasSrcExtensions<PluginBareConfigs extends unknown[]> = TupleToUnion<PickSrcExtensions<PluginBareConfigs>> extends never ? false : true;
589
+
545
590
  declare const HOVERED = "is-hovered";
546
591
 
547
592
  declare const IN_VIEWPORT = "is-in-viewport";
@@ -651,19 +696,24 @@ PluginPlayer extends PlayerWith<_AttachedEventCheck>> extends Plugin_2<PluginOwn
651
696
 
652
697
  declare const LOADING = "is-loading";
653
698
 
654
- declare type MapToConfigs<Arr extends PluginCtor[]> = {
655
- [PluginType in keyof Arr]: Arr[PluginType] extends PluginCtor<ConfigWith<infer ConfigType>> ? ConfigType : never;
699
+ declare type MapToBareConfigs<Plugins extends PluginCtor[]> = {
700
+ [PluginType in keyof Plugins]: ExtractBareConfig<Plugins[PluginType]>;
656
701
  };
657
702
 
658
- declare type MapToPlayerApiExtensions<Arr extends PluginCtor[]> = {
659
- [PluginType in keyof Arr]: Arr[PluginType] extends PluginCtor<infer _uConfigType, PlayerWith<infer PlayerAPIExtension>> ? PlayerAPIExtension : never;
703
+ declare type MapToPlayerExtensions<Plugins extends PluginCtor[]> = {
704
+ [PluginIndex in keyof Plugins]: ExtractPluginPlayerExtension<Plugins[PluginIndex]>;
660
705
  };
661
706
 
662
707
  declare const MENU_OPENED = "has-menu-opened";
663
708
 
664
- declare type MergeConfigs<Arr extends PluginCtor[]> = ArrayToIntersection<MapToConfigs<Arr>>;
709
+ /**
710
+ * Combines plugin config and returns a type derived from Config
711
+ */
712
+ declare type MergeConfigs<Plugins extends PluginCtor[]> = MergePluginConfigs<MapToBareConfigs<Plugins>>;
713
+
714
+ declare type MergePlayerExtensions<Plugins extends PluginCtor[]> = ArrayToIntersection<MapToPlayerExtensions<Plugins>>;
665
715
 
666
- declare type MergePlayerAPIExtensions<Arr extends PluginCtor[]> = ArrayToIntersection<MapToPlayerApiExtensions<Arr>>;
716
+ declare type MergePluginConfigs<PluginBareConfigs extends unknown[]> = HasSrcExtensions<PluginBareConfigs> extends true ? ConfigWithSourceExtensions<PluginBareConfigs> : ConfigWith<ArrayToIntersection<PluginBareConfigs>>;
667
717
 
668
718
  /**
669
719
  * @public
@@ -758,8 +808,6 @@ declare const NO_CONTROLS = "no-controls";
758
808
 
759
809
  declare const NO_DVR = "no-timeline";
760
810
 
761
- declare type NoInfer_2<T> = [T][T extends any ? 0 : never];
762
-
763
811
  /* Excluded from this release type: NON_RECOVERABLE_ERROR */
764
812
 
765
813
  /* Excluded from this release type: NonRecoverableErrorEventDetail */
@@ -778,6 +826,7 @@ declare type OVPMetadata = {
778
826
  category_name?: string;
779
827
  duration?: number;
780
828
  tags?: string;
829
+ playlist_title?: string;
781
830
  };
782
831
 
783
832
  /**
@@ -793,6 +842,26 @@ PAUSE = "pause";
793
842
 
794
843
  declare const PAUSED = "is-paused";
795
844
 
845
+ declare type PickGlobalSrcExtension<PluginSrcs extends unknown[]> = {
846
+ [Index in keyof PluginSrcs]: PluginSrcs[Index] extends {
847
+ type: string;
848
+ } ? unknown : PluginSrcs[Index];
849
+ };
850
+
851
+ /**
852
+ * Maps incoming array to the src extension type
853
+ * @example
854
+ * ```
855
+ * PickSrcExtensions<[
856
+ * {configProp: boolean, src: UnsafeSource<{srcProp: boolean}>},
857
+ * {}
858
+ * ]> // = [{srcProp: boolean}, never]
859
+ * ```
860
+ */
861
+ declare type PickSrcExtensions<PluginBareConfigs extends unknown[]> = {
862
+ [PluginType in keyof PluginBareConfigs]: ExtractSrcExtension<PluginBareConfigs[PluginType]>;
863
+ };
864
+
796
865
  /**
797
866
  * @public
798
867
  */
@@ -914,6 +983,8 @@ declare type PlayerCustomEventsDetailMap = PlayerEmittableCustomEventsDetailMap
914
983
  [DVR]: DvrEventDetail;
915
984
  [RETRY]: RetryEventDetail;
916
985
  [RECOVER]: RecoverEventDetail;
986
+ [QUALITIES]: QualitiesEventDetail;
987
+ [QUALITY_CHANGE]: QualityChangeEventDetail;
917
988
  /* Excluded from this release type: audioonlysource */
918
989
  /* Excluded from this release type: renderplugin */
919
990
  /* Excluded from this release type: "seek:queued" */
@@ -970,7 +1041,10 @@ declare type PlayerCustomEventsOverloads = {
970
1041
  * Emitted when the set of underlying qualities has changed.
971
1042
  */
972
1043
  on(event: typeof QUALITIES, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof QUALITIES]>) => void): Player;
973
- /* Excluded from this release type: on */
1044
+ /**
1045
+ * Emitted when the media changes quality.
1046
+ */
1047
+ on(event: typeof QUALITY_CHANGE, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof QUALITY_CHANGE]>) => void): Player;
974
1048
  /* Excluded from this release type: on */
975
1049
  /**
976
1050
  * Listen to this event to create a recommendations grid using the data passed with the event.
@@ -1025,7 +1099,6 @@ declare type PlayerCustomEventsOverloads = {
1025
1099
  /* Excluded from this release type: emit */
1026
1100
  /* Excluded from this release type: emit */
1027
1101
  /* Excluded from this release type: emit */
1028
- /* Excluded from this release type: emit */
1029
1102
  };
1030
1103
 
1031
1104
  declare type PlayerEmittableCustomEventsDetailMap = {
@@ -1033,7 +1106,6 @@ declare type PlayerEmittableCustomEventsDetailMap = {
1033
1106
  [CONTEXT_MENU]: ContextMenuEventDetail;
1034
1107
  [VIEW_ENTER]: ViewEnterEventDetail;
1035
1108
  [VIEW_LEAVE]: ViewLeaveEventDetail;
1036
- [QUALITIES]: QualitiesEventDetail;
1037
1109
  [RECOMMENDATIONS_READY]: RecommendationsReadyEventDetail;
1038
1110
  };
1039
1111
 
@@ -1135,11 +1207,16 @@ PROGRESS = "progress";
1135
1207
  /**
1136
1208
  * @public
1137
1209
  */
1138
- declare type QselOption = {
1139
- height: number;
1210
+ declare type QselOption = (Level & {
1140
1211
  level: number;
1141
- text: string;
1142
- /* Excluded from this release type: videoCodec */
1212
+ }) | BitrateInfo | {
1213
+ name: string | number;
1214
+ encodingId: string;
1215
+ spatialLayerId: number;
1216
+ temporalLayerId: number;
1217
+ maxSpatialLayerId: number;
1218
+ maxTemporalLayerId: number;
1219
+ height: number;
1143
1220
  width: number;
1144
1221
  };
1145
1222
 
@@ -1163,9 +1240,29 @@ QUALITIES = "qualities";
1163
1240
  */
1164
1241
  declare type QualitiesEventDetail = QselOption[];
1165
1242
 
1166
- /* Excluded from this release type: _QualitiesEventDetail */
1243
+ /**
1244
+ * @public
1245
+ * emitted whenever the media changes quality
1246
+ */
1247
+ declare const /**
1248
+ @public
1249
+ * when a new player is inserted into the HTML
1250
+ */ /**
1251
+ * @public
1252
+ * emitted whenever the media changes quality
1253
+ */
1254
+ QUALITY_CHANGE = "qualitychange";
1167
1255
 
1168
- /* Excluded from this release type: _QualityDetail */
1256
+ /**
1257
+ * @public
1258
+ */
1259
+ declare type QualityChangeEventDetail = {
1260
+ before: Level | BitrateInfo;
1261
+ after: Level | BitrateInfo;
1262
+ plugin: string;
1263
+ automatic: boolean;
1264
+ downscale: boolean;
1265
+ };
1169
1266
 
1170
1267
  declare enum QualityOpts {
1171
1268
  LOW = 1,
@@ -1291,7 +1388,7 @@ declare const RTL = "is-rtl";
1291
1388
  /**
1292
1389
  * @public
1293
1390
  */
1294
- declare const RTS: PluginCtor<Config, Player>;
1391
+ declare const RTS: PluginCtor<NoInfer<Config>, NoInfer<Player>>;
1295
1392
  export default RTS;
1296
1393
 
1297
1394
  /**
@@ -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 { }