@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/ga4.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 {
@@ -541,13 +582,17 @@ FULLSCREEN_EXIT = "fullscreenexit";
541
582
  /**
542
583
  * @public
543
584
  */
544
- declare const GoogleAnalytics4: PluginCtor<Config, Player>;
585
+ declare const GoogleAnalytics4: PluginCtor<NoInfer<Config>, NoInfer<Player>>;
545
586
  export default GoogleAnalytics4;
546
587
 
547
588
  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 { }
package/plugins/ga4.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):((e="undefined"!=typeof globalThis?globalThis:e||self).flowplayer=e.flowplayer||{},e.flowplayer.ga4=t())}(this,(function(){"use strict";return function(e,t){if("object"==typeof exports&&"undefined"!=typeof module)return t;if(null===document.currentScript)return t;"flowplayer"in e||(e.flowplayer={extensions:[]});const i=e.flowplayer;return"function"==typeof i?(i(t),t):(Array.isArray(i.extensions)||(i.extensions=[]),~i.extensions.indexOf(t)||i.extensions.push(t),t)}(window,class GoogleAnalytics4Plugin{constructor(e){this.muted=!1,this.quartiles=[0,0,0],this.ad_type="preroll",this.preroll_counter=0,this.midroll_counter=0,this.postroll_counter=0,this.event_categories={live:"Live",videos:"Videos"},this.event_actions={fullscreen_enter:"fullscreen_enter",fullscreen_exit:"fullscreen_exit",video_player_load:"video_player_load",video_start:"video_start",video_click_play:"video_click_play",video_pause:"video_pause",video_resume:"video_resume",video_mute:"video_mute",video_unmute:"video_unmute",video_25_percent:"video_25_percent",video_50_percent:"video_50_percent",video_75_percent:"video_75_percent",video_complete:"video_complete",live_start:"live_start",live_click_play:"live_click_play",live_pause:"live_pause",live_resume:"live_resume",live_mute:"live_mute",live_unmute:"live_unmute",live_complete:"live_complete",ad_start_preroll:"ad_start_preroll",ad_start_midroll:"ad_start_midroll",ad_start_postroll:"ad_start_postroll",ad_completed_preroll:"ad_completed_preroll",ad_completed_midroll:"ad_completed_midroll",ad_completed_postroll:"ad_completed_postroll",ad_skipped_preroll:"ad_skipped_preroll",ad_skipped_midroll:"ad_skipped_midroll",ad_skipped_postroll:"ad_skipped_postroll",ad_break_completed:"ad_break_completed"},this.flowplayer=e}init(e,t,i){this.config=e,this.video=i,this.muted=i.muted,i.on(["mount","timeupdate","play","ended","pause","playing","volumechange","ad-started","ad-completed","ad-skipped","ad-break-completed","config","play","fullscreenenter","fullscreenexit"],t=>{switch(t.type){case"playing":this.track(e.live?this.event_actions.live_resume:this.event_actions.video_resume);break;case"pause":if(Math.abs(i.duration-i.currentTime)<1)break;this.track(e.live?this.event_actions.live_pause:this.event_actions.video_pause);break;case"play":i.hasState("is-starting")&&this.track(e.live?this.event_actions.live_start:this.event_actions.video_start),this.track(e.live?this.event_actions.live_click_play:this.event_actions.video_click_play);break;case"mount":this.track(this.event_actions.video_player_load);break;case"timeupdate":this.progress(i);break;case"ended":setTimeout(()=>{t.defaultPrevented||(this.track(e.live?this.event_actions.live_complete:this.event_actions.video_complete),this.reset())});break;case"volumechange":this.volumechange(i);break;case"ad-started":this.adstarted(t);break;case"ad-completed":this.adcompleted(t);break;case"ad-break-completed":this.adbreakcompleted();break;case"config":this.configured(t.detail);break;case"fullscreenenter":this.track(this.event_actions.fullscreen_enter);break;case"fullscreenexit":this.track(this.event_actions.fullscreen_exit);break;case"ad-skipped":this.adskipped()}})}progress(e){e.opts.live||(e.currentTime/e.duration>.25&&0===this.quartiles[0]?(this.quartiles[0]=1,this.track(this.event_actions.video_25_percent)):e.currentTime/e.duration>.5&&0===this.quartiles[1]?(this.quartiles[1]=1,this.track(this.event_actions.video_50_percent)):e.currentTime/e.duration>.75&&0===this.quartiles[2]&&(this.quartiles[2]=1,this.track(this.event_actions.video_75_percent)))}volumechange(e){this.muted!==e.muted&&(this.muted=e.muted,e.muted?this.track(e.opts.live?this.event_actions.live_mute:this.event_actions.video_mute):this.track(e.opts.live?this.event_actions.live_unmute:this.event_actions.video_unmute))}reset(){this.quartiles=[0,0,0],this.preroll_counter=0,this.midroll_counter=0,this.postroll_counter=0}configured(e){var t,i;(null===(t=null==e?void 0:e.ga)||void 0===t?void 0:t.event_actions)&&(this.event_actions=e.ga.event_actions),(null===(i=null==e?void 0:e.ga)||void 0===i?void 0:i.event_categories)&&(this.event_categories=e.ga.event_categories)}checkForAdCounter(e,t){return e.replace("[x]",t+"")}adstarted(e){var t;switch((null===(t=e.data)||void 0===t?void 0:t.ad_type)||"preroll"){case"midroll":this.ad_type="midroll",this.midroll_counter++,this.track(this.checkForAdCounter(this.event_actions.ad_start_midroll,this.midroll_counter));break;case"postroll":this.ad_type="postroll",this.postroll_counter++,this.track(this.checkForAdCounter(this.event_actions.ad_start_postroll,this.postroll_counter));break;default:this.ad_type="preroll",this.preroll_counter++,this.track(this.checkForAdCounter(this.event_actions.ad_start_preroll,this.preroll_counter))}}adcompleted(e){var t;switch((null===(t=e.data)||void 0===t?void 0:t.ad_type)||"preroll"){case"midroll":this.track(this.event_actions.ad_completed_midroll);break;case"postroll":this.track(this.event_actions.ad_completed_postroll);break;default:this.track(this.event_actions.ad_completed_preroll)}}adskipped(){if(this.ad_type)switch(this.ad_type){case"midroll":this.track(this.event_actions.ad_skipped_midroll);break;case"postroll":this.track(this.event_actions.ad_skipped_postroll);break;default:this.track(this.event_actions.ad_skipped_preroll)}else this.track(this.event_actions.ad_skipped_preroll)}adbreakcompleted(){this.track(this.event_actions.ad_break_completed)}pushToDataLayer(e,t,i){var s,o;if(window.dataLayer)try{window.dataLayer.push(Object.assign({event:"flowplayer",event_action:e,event_label:i,event_category:t,duration:null===(s=this.video)||void 0===s?void 0:s.duration},null===(o=null==this?void 0:this.config)||void 0===o?void 0:o.ga.custom_data))}catch(e){}}track(e){var t,i,s,o,a,l,r,n;if(!this.config||!this.config.ga||!e||(null===(t=null==this?void 0:this.video)||void 0===t?void 0:t.hasState("consent-no-tracking")))return;const d=(null===(i=this.video)||void 0===i?void 0:i.opts.live)?this.event_categories.live:this.event_categories.videos,c=null===(s=this.config.ga)||void 0===s?void 0:s.ga_instances,_=(null===(o=null==this?void 0:this.config)||void 0===o?void 0:o.title)||(null===(a=this.config.metadata)||void 0===a?void 0:a.title)||"unknown video";if((null===(r=null===(l=this.config)||void 0===l?void 0:l.ga)||void 0===r?void 0:r.data_layer_tracking)||!c||!c.length)return this.pushToDataLayer(e,d,_);gtag("event",e,Object.assign({send_to:c,event_category:d,event_label:_,duration:null===(n=this.video)||void 0===n?void 0:n.duration},this.config.ga.custom_data))}})}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):((e="undefined"!=typeof globalThis?globalThis:e||self).flowplayer=e.flowplayer||{},e.flowplayer.ga4=t())}(this,(function(){"use strict";return function(e,t){if("object"==typeof exports&&"undefined"!=typeof module)return t;if(null===document.currentScript)return t;"flowplayer"in e||(e.flowplayer={extensions:[]});const i=e.flowplayer;return"function"==typeof i?(i(t),t):(Array.isArray(i.extensions)||(i.extensions=[]),~i.extensions.indexOf(t)||i.extensions.push(t),t)}(window,class GoogleAnalytics4Plugin{constructor(e){this.muted=!1,this.quartiles=[0,0,0],this.ad_type="preroll",this.preroll_counter=0,this.midroll_counter=0,this.postroll_counter=0,this.event_categories={live:"Live",videos:"Videos"},this.event_actions={fullscreen_enter:"fullscreen_enter",fullscreen_exit:"fullscreen_exit",video_player_load:"video_player_load",video_start:"video_start",video_click_play:"video_click_play",video_pause:"video_pause",video_resume:"video_resume",video_seeking:"video_seeking",video_ratechange:"video_ratechange",video_qualitychange:"video_qualitychange",video_mute:"video_mute",video_unmute:"video_unmute",video_25_percent:"video_25_percent",video_50_percent:"video_50_percent",video_75_percent:"video_75_percent",video_complete:"video_complete",live_start:"live_start",live_click_play:"live_click_play",live_pause:"live_pause",live_resume:"live_resume",live_ratechange:"live_ratechange",live_seeking:"live_seeking",live_qualitychange:"live_qualitychange",live_mute:"live_mute",live_unmute:"live_unmute",live_complete:"live_complete",ad_start_preroll:"ad_start_preroll",ad_start_midroll:"ad_start_midroll",ad_start_postroll:"ad_start_postroll",ad_completed_preroll:"ad_completed_preroll",ad_completed_midroll:"ad_completed_midroll",ad_completed_postroll:"ad_completed_postroll",ad_skipped_preroll:"ad_skipped_preroll",ad_skipped_midroll:"ad_skipped_midroll",ad_skipped_postroll:"ad_skipped_postroll",ad_break_completed:"ad_break_completed"},this.flowplayer=e}init(e,t,i){this.config=e,this.video=i,this.muted=i.muted,i.on(["mount","timeupdate","play","ended","pause","playing","volumechange","ad-started","ad-completed","ad-skipped","ad-break-completed","config","play","fullscreenenter","fullscreenexit","seeking","qualitychange","ratechange"],t=>{var a,s,o;switch(t.type){case"playing":this.track(e.live?this.event_actions.live_resume:this.event_actions.video_resume);break;case"pause":if(Math.abs(i.duration-i.currentTime)<1)break;this.track(e.live?this.event_actions.live_pause:this.event_actions.video_pause);break;case"seeking":this.track(e.live?this.event_actions.live_seeking:this.event_actions.video_seeking);break;case"ratechange":this.track(e.live?this.event_actions.live_ratechange:this.event_actions.video_ratechange,{playbackRate:null===(a=this.video)||void 0===a?void 0:a.playbackRate});break;case"qualitychange":{const i=t.detail;this.track(e.live?this.event_actions.live_qualitychange:this.event_actions.video_qualitychange,{before:null===(s=i.before)||void 0===s?void 0:s.height,after:null===(o=i.after)||void 0===o?void 0:o.height});break}case"play":i.hasState("is-starting")&&this.track(e.live?this.event_actions.live_start:this.event_actions.video_start),this.track(e.live?this.event_actions.live_click_play:this.event_actions.video_click_play);break;case"mount":this.track(this.event_actions.video_player_load);break;case"timeupdate":this.progress(i);break;case"ended":setTimeout(()=>{t.defaultPrevented||(this.track(e.live?this.event_actions.live_complete:this.event_actions.video_complete),this.reset())});break;case"volumechange":this.volumechange(i);break;case"ad-started":this.adstarted(t);break;case"ad-completed":this.adcompleted(t);break;case"ad-break-completed":this.adbreakcompleted();break;case"config":this.configured(t.detail);break;case"fullscreenenter":this.track(this.event_actions.fullscreen_enter);break;case"fullscreenexit":this.track(this.event_actions.fullscreen_exit);break;case"ad-skipped":this.adskipped()}})}progress(e){e.opts.live||(e.currentTime/e.duration>.25&&0===this.quartiles[0]?(this.quartiles[0]=1,this.track(this.event_actions.video_25_percent)):e.currentTime/e.duration>.5&&0===this.quartiles[1]?(this.quartiles[1]=1,this.track(this.event_actions.video_50_percent)):e.currentTime/e.duration>.75&&0===this.quartiles[2]&&(this.quartiles[2]=1,this.track(this.event_actions.video_75_percent)))}volumechange(e){this.muted!==e.muted&&(this.muted=e.muted,e.muted?this.track(e.opts.live?this.event_actions.live_mute:this.event_actions.video_mute):this.track(e.opts.live?this.event_actions.live_unmute:this.event_actions.video_unmute))}reset(){this.quartiles=[0,0,0],this.preroll_counter=0,this.midroll_counter=0,this.postroll_counter=0}configured(e){var t,i;(null===(t=null==e?void 0:e.ga)||void 0===t?void 0:t.event_actions)&&(this.event_actions=e.ga.event_actions),(null===(i=null==e?void 0:e.ga)||void 0===i?void 0:i.event_categories)&&(this.event_categories=e.ga.event_categories)}checkForAdCounter(e,t){return e.replace("[x]",t+"")}adstarted(e){var t;switch((null===(t=e.data)||void 0===t?void 0:t.ad_type)||"preroll"){case"midroll":this.ad_type="midroll",this.midroll_counter++,this.track(this.checkForAdCounter(this.event_actions.ad_start_midroll,this.midroll_counter));break;case"postroll":this.ad_type="postroll",this.postroll_counter++,this.track(this.checkForAdCounter(this.event_actions.ad_start_postroll,this.postroll_counter));break;default:this.ad_type="preroll",this.preroll_counter++,this.track(this.checkForAdCounter(this.event_actions.ad_start_preroll,this.preroll_counter))}}adcompleted(e){var t;switch((null===(t=e.data)||void 0===t?void 0:t.ad_type)||"preroll"){case"midroll":this.track(this.event_actions.ad_completed_midroll);break;case"postroll":this.track(this.event_actions.ad_completed_postroll);break;default:this.track(this.event_actions.ad_completed_preroll)}}adskipped(){if(this.ad_type)switch(this.ad_type){case"midroll":this.track(this.event_actions.ad_skipped_midroll);break;case"postroll":this.track(this.event_actions.ad_skipped_postroll);break;default:this.track(this.event_actions.ad_skipped_preroll)}else this.track(this.event_actions.ad_skipped_preroll)}adbreakcompleted(){this.track(this.event_actions.ad_break_completed)}pushToDataLayer(e,t,i,a){var s,o;if(window.dataLayer)try{window.dataLayer.push(Object.assign(Object.assign({event:"flowplayer",event_action:e,event_label:i,event_category:t,duration:null===(s=this.video)||void 0===s?void 0:s.duration},null===(o=null==this?void 0:this.config)||void 0===o?void 0:o.ga.custom_data),a))}catch(e){console.error(e)}}track(e,t){var i,a,s,o,l,r,n,d;if(!this.config||!this.config.ga||(null===(i=null==this?void 0:this.video)||void 0===i?void 0:i.hasState("consent-no-tracking")))return;const c=(null===(a=this.video)||void 0===a?void 0:a.opts.live)?this.event_categories.live:this.event_categories.videos,_=null===(s=this.config.ga)||void 0===s?void 0:s.ga_instances,v=(null===(o=null==this?void 0:this.config)||void 0===o?void 0:o.title)||(null===(l=this.config.metadata)||void 0===l?void 0:l.title)||"unknown video";if(!window.gtag||(null===(n=null===(r=this.config)||void 0===r?void 0:r.ga)||void 0===n?void 0:n.data_layer_tracking)||!_||!_.length)return this.pushToDataLayer(e,c,v,t);gtag("event",e,Object.assign(Object.assign({send_to:_,event_category:c,event_label:v,duration:null===(d=this.video)||void 0===d?void 0:d.duration},this.config.ga.custom_data),t))}})}));
@@ -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 {
@@ -541,7 +582,7 @@ FULLSCREEN_EXIT = "fullscreenexit";
541
582
  /**
542
583
  * @public
543
584
  */
544
- declare const Gemius: PluginCtor<GemiusConfig, Player>;
585
+ declare const Gemius: PluginCtor<NoInfer<GemiusConfig>, NoInfer<Player>>;
545
586
  export default Gemius;
546
587
 
547
588
  /**
@@ -573,6 +614,10 @@ declare const GRABBING = "is-grabbing";
573
614
 
574
615
  declare const HAS_POSTER = "has-poster";
575
616
 
617
+ declare type HasGlobalSrcExtensios<PluginSrcs extends unknown[]> = ArrayToIntersection<PickGlobalSrcExtension<PluginSrcs>>;
618
+
619
+ declare type HasSrcExtensions<PluginBareConfigs extends unknown[]> = TupleToUnion<PickSrcExtensions<PluginBareConfigs>> extends never ? false : true;
620
+
576
621
  declare const HOVERED = "is-hovered";
577
622
 
578
623
  declare const IN_VIEWPORT = "is-in-viewport";
@@ -682,19 +727,24 @@ PluginPlayer extends PlayerWith<_AttachedEventCheck>> extends Plugin_2<PluginOwn
682
727
 
683
728
  declare const LOADING = "is-loading";
684
729
 
685
- declare type MapToConfigs<Arr extends PluginCtor[]> = {
686
- [PluginType in keyof Arr]: Arr[PluginType] extends PluginCtor<ConfigWith<infer ConfigType>> ? ConfigType : never;
730
+ declare type MapToBareConfigs<Plugins extends PluginCtor[]> = {
731
+ [PluginType in keyof Plugins]: ExtractBareConfig<Plugins[PluginType]>;
687
732
  };
688
733
 
689
- declare type MapToPlayerApiExtensions<Arr extends PluginCtor[]> = {
690
- [PluginType in keyof Arr]: Arr[PluginType] extends PluginCtor<infer _uConfigType, PlayerWith<infer PlayerAPIExtension>> ? PlayerAPIExtension : never;
734
+ declare type MapToPlayerExtensions<Plugins extends PluginCtor[]> = {
735
+ [PluginIndex in keyof Plugins]: ExtractPluginPlayerExtension<Plugins[PluginIndex]>;
691
736
  };
692
737
 
693
738
  declare const MENU_OPENED = "has-menu-opened";
694
739
 
695
- declare type MergeConfigs<Arr extends PluginCtor[]> = ArrayToIntersection<MapToConfigs<Arr>>;
740
+ /**
741
+ * Combines plugin config and returns a type derived from Config
742
+ */
743
+ declare type MergeConfigs<Plugins extends PluginCtor[]> = MergePluginConfigs<MapToBareConfigs<Plugins>>;
744
+
745
+ declare type MergePlayerExtensions<Plugins extends PluginCtor[]> = ArrayToIntersection<MapToPlayerExtensions<Plugins>>;
696
746
 
697
- declare type MergePlayerAPIExtensions<Arr extends PluginCtor[]> = ArrayToIntersection<MapToPlayerApiExtensions<Arr>>;
747
+ declare type MergePluginConfigs<PluginBareConfigs extends unknown[]> = HasSrcExtensions<PluginBareConfigs> extends true ? ConfigWithSourceExtensions<PluginBareConfigs> : ConfigWith<ArrayToIntersection<PluginBareConfigs>>;
698
748
 
699
749
  /**
700
750
  * @public
@@ -789,8 +839,6 @@ declare const NO_CONTROLS = "no-controls";
789
839
 
790
840
  declare const NO_DVR = "no-timeline";
791
841
 
792
- declare type NoInfer_2<T> = [T][T extends any ? 0 : never];
793
-
794
842
  /* Excluded from this release type: NON_RECOVERABLE_ERROR */
795
843
 
796
844
  /* Excluded from this release type: NonRecoverableErrorEventDetail */
@@ -809,6 +857,7 @@ declare type OVPMetadata = {
809
857
  category_name?: string;
810
858
  duration?: number;
811
859
  tags?: string;
860
+ playlist_title?: string;
812
861
  };
813
862
 
814
863
  /**
@@ -824,6 +873,26 @@ PAUSE = "pause";
824
873
 
825
874
  declare const PAUSED = "is-paused";
826
875
 
876
+ declare type PickGlobalSrcExtension<PluginSrcs extends unknown[]> = {
877
+ [Index in keyof PluginSrcs]: PluginSrcs[Index] extends {
878
+ type: string;
879
+ } ? unknown : PluginSrcs[Index];
880
+ };
881
+
882
+ /**
883
+ * Maps incoming array to the src extension type
884
+ * @example
885
+ * ```
886
+ * PickSrcExtensions<[
887
+ * {configProp: boolean, src: UnsafeSource<{srcProp: boolean}>},
888
+ * {}
889
+ * ]> // = [{srcProp: boolean}, never]
890
+ * ```
891
+ */
892
+ declare type PickSrcExtensions<PluginBareConfigs extends unknown[]> = {
893
+ [PluginType in keyof PluginBareConfigs]: ExtractSrcExtension<PluginBareConfigs[PluginType]>;
894
+ };
895
+
827
896
  /**
828
897
  * @public
829
898
  */
@@ -945,6 +1014,8 @@ declare type PlayerCustomEventsDetailMap = PlayerEmittableCustomEventsDetailMap
945
1014
  [DVR]: DvrEventDetail;
946
1015
  [RETRY]: RetryEventDetail;
947
1016
  [RECOVER]: RecoverEventDetail;
1017
+ [QUALITIES]: QualitiesEventDetail;
1018
+ [QUALITY_CHANGE]: QualityChangeEventDetail;
948
1019
  /* Excluded from this release type: audioonlysource */
949
1020
  /* Excluded from this release type: renderplugin */
950
1021
  /* Excluded from this release type: "seek:queued" */
@@ -1001,7 +1072,10 @@ declare type PlayerCustomEventsOverloads = {
1001
1072
  * Emitted when the set of underlying qualities has changed.
1002
1073
  */
1003
1074
  on(event: typeof QUALITIES, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof QUALITIES]>) => void): Player;
1004
- /* Excluded from this release type: on */
1075
+ /**
1076
+ * Emitted when the media changes quality.
1077
+ */
1078
+ on(event: typeof QUALITY_CHANGE, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof QUALITY_CHANGE]>) => void): Player;
1005
1079
  /* Excluded from this release type: on */
1006
1080
  /**
1007
1081
  * Listen to this event to create a recommendations grid using the data passed with the event.
@@ -1056,7 +1130,6 @@ declare type PlayerCustomEventsOverloads = {
1056
1130
  /* Excluded from this release type: emit */
1057
1131
  /* Excluded from this release type: emit */
1058
1132
  /* Excluded from this release type: emit */
1059
- /* Excluded from this release type: emit */
1060
1133
  };
1061
1134
 
1062
1135
  declare type PlayerEmittableCustomEventsDetailMap = {
@@ -1064,7 +1137,6 @@ declare type PlayerEmittableCustomEventsDetailMap = {
1064
1137
  [CONTEXT_MENU]: ContextMenuEventDetail;
1065
1138
  [VIEW_ENTER]: ViewEnterEventDetail;
1066
1139
  [VIEW_LEAVE]: ViewLeaveEventDetail;
1067
- [QUALITIES]: QualitiesEventDetail;
1068
1140
  [RECOMMENDATIONS_READY]: RecommendationsReadyEventDetail;
1069
1141
  };
1070
1142
 
@@ -1166,11 +1238,16 @@ PROGRESS = "progress";
1166
1238
  /**
1167
1239
  * @public
1168
1240
  */
1169
- declare type QselOption = {
1170
- height: number;
1241
+ declare type QselOption = (Level & {
1171
1242
  level: number;
1172
- text: string;
1173
- /* Excluded from this release type: videoCodec */
1243
+ }) | BitrateInfo | {
1244
+ name: string | number;
1245
+ encodingId: string;
1246
+ spatialLayerId: number;
1247
+ temporalLayerId: number;
1248
+ maxSpatialLayerId: number;
1249
+ maxTemporalLayerId: number;
1250
+ height: number;
1174
1251
  width: number;
1175
1252
  };
1176
1253
 
@@ -1194,9 +1271,29 @@ QUALITIES = "qualities";
1194
1271
  */
1195
1272
  declare type QualitiesEventDetail = QselOption[];
1196
1273
 
1197
- /* Excluded from this release type: _QualitiesEventDetail */
1274
+ /**
1275
+ * @public
1276
+ * emitted whenever the media changes quality
1277
+ */
1278
+ declare const /**
1279
+ @public
1280
+ * when a new player is inserted into the HTML
1281
+ */ /**
1282
+ * @public
1283
+ * emitted whenever the media changes quality
1284
+ */
1285
+ QUALITY_CHANGE = "qualitychange";
1198
1286
 
1199
- /* Excluded from this release type: _QualityDetail */
1287
+ /**
1288
+ * @public
1289
+ */
1290
+ declare type QualityChangeEventDetail = {
1291
+ before: Level | BitrateInfo;
1292
+ after: Level | BitrateInfo;
1293
+ plugin: string;
1294
+ automatic: boolean;
1295
+ downscale: boolean;
1296
+ };
1200
1297
 
1201
1298
  declare enum QualityOpts {
1202
1299
  LOW = 1,
@@ -1402,14 +1499,14 @@ declare type SourceEventDetail = SourceObj;
1402
1499
  /**
1403
1500
  * @public
1404
1501
  */
1405
- declare type SourceObj = {
1502
+ declare type SourceObj<T = unknown> = {
1406
1503
  src?: SourceStr;
1407
1504
  /**
1408
1505
  * the MIME type (example `video/mp4` or `application/x-mpegurl`)
1409
1506
  */
1410
1507
  type?: string;
1411
1508
  drm?: DRMSourceConfiguration;
1412
- };
1509
+ } & T;
1413
1510
 
1414
1511
  /**
1415
1512
  * @public
@@ -1536,7 +1633,7 @@ declare const TV = "is-tv";
1536
1633
  /**
1537
1634
  * @public
1538
1635
  */
1539
- declare type UnsafeSource = SourceStr | SourceObj | Array<SourceStr | SourceObj>;
1636
+ declare type UnsafeSource<SrcMixin = unknown> = SourceStr | SourceObj<SrcMixin> | Array<SourceStr | SourceObj<SrcMixin>>;
1540
1637
 
1541
1638
  /**
1542
1639
  * @public
@@ -1632,9 +1729,6 @@ declare const WILL_PLAY = "will-play";
1632
1729
 
1633
1730
  declare const WILL_SEEK = "will-seek";
1634
1731
 
1635
- declare type WithOpts<PluginPlayer extends Player = Player, PluginConfig extends Config = Config> = PluginPlayer & {
1636
- opts: PluginConfig;
1637
- setOpts(config: PluginConfig): void;
1638
- };
1732
+ declare type WithOpts<PluginPlayer extends Player = Player, PluginConfig extends Config = Config> = SetFieldType<SetFieldType<PluginPlayer, "opts", PluginConfig>, "setOpts", (config: PluginConfig) => void>;
1639
1733
 
1640
1734
  export { }