@flowplayer/player 3.15.0-rc.8 → 3.15.0

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 (51) hide show
  1. package/core.js +1 -1
  2. package/default.js +1 -1
  3. package/embed.js +2 -2
  4. package/index.d.ts +16 -10
  5. package/package.json +1 -1
  6. package/plugins/ads.d.ts +19 -13
  7. package/plugins/ads.js +1 -1
  8. package/plugins/airplay.d.ts +19 -13
  9. package/plugins/analytics.d.ts +16 -10
  10. package/plugins/analytics.js +1 -1
  11. package/plugins/asel.d.ts +16 -10
  12. package/plugins/audio.d.ts +16 -10
  13. package/plugins/chapters.d.ts +16 -10
  14. package/plugins/chromecast.d.ts +16 -10
  15. package/plugins/comscore.d.ts +16 -10
  16. package/plugins/consent.d.ts +16 -10
  17. package/plugins/context-menu.d.ts +17 -11
  18. package/plugins/cuepoints.d.ts +17 -11
  19. package/plugins/dash.d.ts +23 -15
  20. package/plugins/drm.d.ts +16 -10
  21. package/plugins/endscreen.d.ts +16 -10
  22. package/plugins/fas.d.ts +16 -10
  23. package/plugins/float-on-scroll.d.ts +16 -10
  24. package/plugins/ga4.d.ts +16 -10
  25. package/plugins/gemius.d.ts +16 -10
  26. package/plugins/google-analytics.d.ts +16 -10
  27. package/plugins/health.d.ts +22 -13
  28. package/plugins/health.js +1 -1
  29. package/plugins/hls.d.ts +19 -13
  30. package/plugins/id3.d.ts +16 -10
  31. package/plugins/iframe.d.ts +16 -10
  32. package/plugins/keyboard.d.ts +16 -10
  33. package/plugins/media-session.d.ts +16 -10
  34. package/plugins/message.d.ts +16 -10
  35. package/plugins/ovp.d.ts +31 -24
  36. package/plugins/ovp.js +1 -1
  37. package/plugins/playlist.d.ts +16 -10
  38. package/plugins/preview.d.ts +16 -10
  39. package/plugins/qsel.d.ts +16 -10
  40. package/plugins/qul.d.ts +16 -10
  41. package/plugins/rts.d.ts +16 -10
  42. package/plugins/share.d.ts +16 -10
  43. package/plugins/speed.d.ts +16 -10
  44. package/plugins/ssai.d.ts +16 -10
  45. package/plugins/ssai.js +1 -1
  46. package/plugins/subtitles.d.ts +19 -13
  47. package/plugins/thumbnails.d.ts +16 -10
  48. package/plugins/tizen.d.ts +16 -10
  49. package/plugins/vtsel.d.ts +16 -10
  50. package/plugins/webos.d.ts +16 -10
  51. package/util/loader.d.ts +18 -12
@@ -315,6 +315,8 @@ declare const /**
315
315
  */
316
316
  ENDED_2 = "ended";
317
317
 
318
+ declare type EnsureOnAttached<P extends Function, T extends Player> = ExtractPureAPI<T> extends _AttachedEventCheck ? P : "Loaders must implement on('<pluginname>:attached') event";
319
+
318
320
  /**
319
321
  * @public
320
322
  */
@@ -397,6 +399,8 @@ declare namespace events {
397
399
  }
398
400
  }
399
401
 
402
+ declare type ExtractPureAPI<T> = T extends PlayerWith<infer PureAPI> ? PureAPI : never;
403
+
400
404
  /**
401
405
  * @public
402
406
  */
@@ -474,19 +478,19 @@ declare interface FlowplayerUMDBase {
474
478
  /**
475
479
  * @public
476
480
  */
477
- declare interface FlowplayerUMDWithPlugins<ConfigWithPlugins extends Config = Config, PluginPlayerAPIExtension extends Player = Player> extends FlowplayerUMDBase {
481
+ declare interface FlowplayerUMDWithPlugins<ConfigWithPlugins extends Config = Config, PluginPlayer extends Player = Player> extends FlowplayerUMDBase {
478
482
  /**
479
483
  * Configure flowplayer, it's attached plugins and display flowplayer it in the UI
480
484
  * @param selector - query selector of the HTML element where player will render
481
485
  * @param config - Configuration of the flowplayer and the attached plugins
482
486
  */
483
- (selector: string, config?: ConfigWithPlugins): PluginPlayerAPIExtension;
487
+ (selector: string, config?: ConfigWithPlugins): PluginPlayer;
484
488
  /**
485
489
  * Configure flowplayer, it's attached plugins and display flowplayer it in the UI
486
490
  * @param element - HTML element where player will render
487
491
  * @param config - Configuration of the flowplayer and the attached plugins
488
492
  */
489
- (element: HTMLElement, config?: ConfigWithPlugins): PluginPlayerAPIExtension;
493
+ (element: HTMLElement, config?: ConfigWithPlugins): PluginPlayer;
490
494
  }
491
495
 
492
496
  /**
@@ -638,10 +642,11 @@ declare const LOADED = "is-loaded";
638
642
 
639
643
  /**
640
644
  * @public A plugin that supports loading new media formats. Use 'class MyPlugin implements Loader\<...\>' when writing your custom Loader
641
- * @typeParam PluginPlayerAPIExtension - additional Player API that will be implemented by the loader. Loader at least must implement on(\<loader-name\>:attached, ...) event handler
645
+ * @typeParam PluginPlayer- Player API that will be implemented by the loader. Loader at least must implement on(\<loader-name\>:attached, ...) event handler
642
646
  */
643
- declare interface Loader<PluginOwnConfig extends KeyValue, PluginPlayerAPIExtension extends _AttachedEventCheck> extends Plugin_2<PluginOwnConfig, PlayerWith<PluginPlayerAPIExtension>> {
644
- onload(config: ConfigWith<PluginOwnConfig>, root: PlayerRoot, video: PlayerWith<PluginPlayerAPIExtension>, src?: SourceObj): void;
647
+ declare interface Loader<PluginOwnConfig extends KeyValue, // FIXME extends Config
648
+ PluginPlayer extends PlayerWith<_AttachedEventCheck>> extends Plugin_2<PluginOwnConfig, PluginPlayer> {
649
+ onload: EnsureOnAttached<(config: ConfigWith<PluginOwnConfig>, root: PlayerRoot, video: PlayerWith<PluginPlayer>, src: SourceObj) => void, PluginPlayer>;
645
650
  wants<S = SourceObj>(srcString: SourceStr, srcObj: S, config: ConfigWith<PluginOwnConfig>): boolean;
646
651
  wants<S = KeyValue>(srcString: SourceStr, srcObj: SourceWith<S>, config: ConfigWith<PluginOwnConfig>): boolean;
647
652
  }
@@ -1038,6 +1043,7 @@ declare type PlayerNativeEventsOverloads = {
1038
1043
 
1039
1044
  /**
1040
1045
  * @public
1046
+ * The root element of the video player. This is the immediate parent element of the video tag.
1041
1047
  */
1042
1048
  declare type PlayerRoot = HTMLElement & {
1043
1049
  /* Excluded from this release type: prevWidth */
@@ -1073,11 +1079,11 @@ PLAYING_2 = "playing";
1073
1079
  /**
1074
1080
  * @public
1075
1081
  */
1076
- declare interface Plugin_2<PluginConfig extends Config = Config, PluginPlayerAPI extends Player = Player> {
1082
+ declare interface Plugin_2<PluginConfig extends Config = Config, PluginPlayer extends Player = Player> {
1077
1083
  /**
1078
1084
  * a plugin must always implement the init method so a player instance knows how to initialize it
1079
1085
  */
1080
- init(config: PluginConfig, container: PlayerRoot, player: PluginPlayerAPI): void;
1086
+ init(config: PluginConfig, container: PlayerRoot, player: PluginPlayer): void;
1081
1087
  }
1082
1088
 
1083
1089
  /* Excluded from this release type: PLUGIN_REGISTERED */
@@ -1085,8 +1091,8 @@ declare interface Plugin_2<PluginConfig extends Config = Config, PluginPlayerAPI
1085
1091
  /**
1086
1092
  * @public
1087
1093
  */
1088
- declare interface PluginCtor<PluginConfig extends Config = Config, PluginPlayerAPI extends Player = Player> {
1089
- new (umd: FlowplayerUMD, player: PluginPlayerAPI): Plugin_2<PluginConfig, PluginPlayerAPI>;
1094
+ declare interface PluginCtor<PluginConfig extends Config = Config, PluginPlayer extends Player = Player> {
1095
+ new (umd: FlowplayerUMD, player: PluginPlayer): Plugin_2<PluginConfig, PluginPlayer>;
1090
1096
  }
1091
1097
 
1092
1098
  /* Excluded from this release type: PluginRegisteredEventDetail */
@@ -315,6 +315,8 @@ declare const /**
315
315
  */
316
316
  ENDED_2 = "ended";
317
317
 
318
+ declare type EnsureOnAttached<P extends Function, T extends Player> = ExtractPureAPI<T> extends _AttachedEventCheck ? P : "Loaders must implement on('<pluginname>:attached') event";
319
+
318
320
  /**
319
321
  * @public
320
322
  */
@@ -397,6 +399,8 @@ declare namespace events {
397
399
  }
398
400
  }
399
401
 
402
+ declare type ExtractPureAPI<T> = T extends PlayerWith<infer PureAPI> ? PureAPI : never;
403
+
400
404
  /**
401
405
  * @public
402
406
  */
@@ -474,19 +478,19 @@ declare interface FlowplayerUMDBase {
474
478
  /**
475
479
  * @public
476
480
  */
477
- declare interface FlowplayerUMDWithPlugins<ConfigWithPlugins extends Config = Config, PluginPlayerAPIExtension extends Player = Player> extends FlowplayerUMDBase {
481
+ declare interface FlowplayerUMDWithPlugins<ConfigWithPlugins extends Config = Config, PluginPlayer extends Player = Player> extends FlowplayerUMDBase {
478
482
  /**
479
483
  * Configure flowplayer, it's attached plugins and display flowplayer it in the UI
480
484
  * @param selector - query selector of the HTML element where player will render
481
485
  * @param config - Configuration of the flowplayer and the attached plugins
482
486
  */
483
- (selector: string, config?: ConfigWithPlugins): PluginPlayerAPIExtension;
487
+ (selector: string, config?: ConfigWithPlugins): PluginPlayer;
484
488
  /**
485
489
  * Configure flowplayer, it's attached plugins and display flowplayer it in the UI
486
490
  * @param element - HTML element where player will render
487
491
  * @param config - Configuration of the flowplayer and the attached plugins
488
492
  */
489
- (element: HTMLElement, config?: ConfigWithPlugins): PluginPlayerAPIExtension;
493
+ (element: HTMLElement, config?: ConfigWithPlugins): PluginPlayer;
490
494
  }
491
495
 
492
496
  /**
@@ -638,10 +642,11 @@ declare const LOADED = "is-loaded";
638
642
 
639
643
  /**
640
644
  * @public A plugin that supports loading new media formats. Use 'class MyPlugin implements Loader\<...\>' when writing your custom Loader
641
- * @typeParam PluginPlayerAPIExtension - additional Player API that will be implemented by the loader. Loader at least must implement on(\<loader-name\>:attached, ...) event handler
645
+ * @typeParam PluginPlayer- Player API that will be implemented by the loader. Loader at least must implement on(\<loader-name\>:attached, ...) event handler
642
646
  */
643
- declare interface Loader<PluginOwnConfig extends KeyValue, PluginPlayerAPIExtension extends _AttachedEventCheck> extends Plugin_2<PluginOwnConfig, PlayerWith<PluginPlayerAPIExtension>> {
644
- onload(config: ConfigWith<PluginOwnConfig>, root: PlayerRoot, video: PlayerWith<PluginPlayerAPIExtension>, src?: SourceObj): void;
647
+ declare interface Loader<PluginOwnConfig extends KeyValue, // FIXME extends Config
648
+ PluginPlayer extends PlayerWith<_AttachedEventCheck>> extends Plugin_2<PluginOwnConfig, PluginPlayer> {
649
+ onload: EnsureOnAttached<(config: ConfigWith<PluginOwnConfig>, root: PlayerRoot, video: PlayerWith<PluginPlayer>, src: SourceObj) => void, PluginPlayer>;
645
650
  wants<S = SourceObj>(srcString: SourceStr, srcObj: S, config: ConfigWith<PluginOwnConfig>): boolean;
646
651
  wants<S = KeyValue>(srcString: SourceStr, srcObj: SourceWith<S>, config: ConfigWith<PluginOwnConfig>): boolean;
647
652
  }
@@ -1038,6 +1043,7 @@ declare type PlayerNativeEventsOverloads = {
1038
1043
 
1039
1044
  /**
1040
1045
  * @public
1046
+ * The root element of the video player. This is the immediate parent element of the video tag.
1041
1047
  */
1042
1048
  declare type PlayerRoot = HTMLElement & {
1043
1049
  /* Excluded from this release type: prevWidth */
@@ -1073,11 +1079,11 @@ PLAYING_2 = "playing";
1073
1079
  /**
1074
1080
  * @public
1075
1081
  */
1076
- declare interface Plugin_2<PluginConfig extends Config = Config, PluginPlayerAPI extends Player = Player> {
1082
+ declare interface Plugin_2<PluginConfig extends Config = Config, PluginPlayer extends Player = Player> {
1077
1083
  /**
1078
1084
  * a plugin must always implement the init method so a player instance knows how to initialize it
1079
1085
  */
1080
- init(config: PluginConfig, container: PlayerRoot, player: PluginPlayerAPI): void;
1086
+ init(config: PluginConfig, container: PlayerRoot, player: PluginPlayer): void;
1081
1087
  }
1082
1088
 
1083
1089
  /* Excluded from this release type: PLUGIN_REGISTERED */
@@ -1085,8 +1091,8 @@ declare interface Plugin_2<PluginConfig extends Config = Config, PluginPlayerAPI
1085
1091
  /**
1086
1092
  * @public
1087
1093
  */
1088
- declare interface PluginCtor<PluginConfig extends Config = Config, PluginPlayerAPI extends Player = Player> {
1089
- new (umd: FlowplayerUMD, player: PluginPlayerAPI): Plugin_2<PluginConfig, PluginPlayerAPI>;
1094
+ declare interface PluginCtor<PluginConfig extends Config = Config, PluginPlayer extends Player = Player> {
1095
+ new (umd: FlowplayerUMD, player: PluginPlayer): Plugin_2<PluginConfig, PluginPlayer>;
1090
1096
  }
1091
1097
 
1092
1098
  /* Excluded from this release type: PluginRegisteredEventDetail */
package/util/loader.d.ts CHANGED
@@ -237,8 +237,8 @@ DBL_CLICK = "dblclick";
237
237
  * adds support for asynchronous plugin loading
238
238
  * issue/127
239
239
  */
240
- export declare function define<PluginConfig extends Config = Config, PluginPlayerAPI extends Player = Player, PublicAPI = unknown>(root: any, // TODO type this to PlayerRoot
241
- plugin: PluginCtor<NoInfer<PluginConfig>, NoInfer<PluginPlayerAPI>> & NoInfer<PublicAPI>): typeof plugin;
240
+ export declare function define<PluginConfig extends Config = Config, PluginPlayer extends Player = Player, PublicAPI = unknown>(root: any, // TODO type this to PlayerRoot
241
+ plugin: PluginCtor<NoInfer<PluginConfig>, NoInfer<PluginPlayer>> & NoInfer<PublicAPI>): typeof plugin;
242
242
 
243
243
  declare const DESTROYED = "is-destroyed";
244
244
 
@@ -323,6 +323,8 @@ declare const /**
323
323
  */
324
324
  ENDED_2 = "ended";
325
325
 
326
+ declare type EnsureOnAttached<P extends Function, T extends Player> = ExtractPureAPI<T> extends _AttachedEventCheck ? P : "Loaders must implement on('<pluginname>:attached') event";
327
+
326
328
  /**
327
329
  * @public
328
330
  */
@@ -405,6 +407,8 @@ declare namespace events {
405
407
  }
406
408
  }
407
409
 
410
+ declare type ExtractPureAPI<T> = T extends PlayerWith<infer PureAPI> ? PureAPI : never;
411
+
408
412
  /**
409
413
  * @public
410
414
  */
@@ -482,19 +486,19 @@ declare interface FlowplayerUMDBase {
482
486
  /**
483
487
  * @public
484
488
  */
485
- declare interface FlowplayerUMDWithPlugins<ConfigWithPlugins extends Config = Config, PluginPlayerAPIExtension extends Player = Player> extends FlowplayerUMDBase {
489
+ declare interface FlowplayerUMDWithPlugins<ConfigWithPlugins extends Config = Config, PluginPlayer extends Player = Player> extends FlowplayerUMDBase {
486
490
  /**
487
491
  * Configure flowplayer, it's attached plugins and display flowplayer it in the UI
488
492
  * @param selector - query selector of the HTML element where player will render
489
493
  * @param config - Configuration of the flowplayer and the attached plugins
490
494
  */
491
- (selector: string, config?: ConfigWithPlugins): PluginPlayerAPIExtension;
495
+ (selector: string, config?: ConfigWithPlugins): PluginPlayer;
492
496
  /**
493
497
  * Configure flowplayer, it's attached plugins and display flowplayer it in the UI
494
498
  * @param element - HTML element where player will render
495
499
  * @param config - Configuration of the flowplayer and the attached plugins
496
500
  */
497
- (element: HTMLElement, config?: ConfigWithPlugins): PluginPlayerAPIExtension;
501
+ (element: HTMLElement, config?: ConfigWithPlugins): PluginPlayer;
498
502
  }
499
503
 
500
504
  /**
@@ -651,10 +655,11 @@ declare const LOADED = "is-loaded";
651
655
 
652
656
  /**
653
657
  * @public A plugin that supports loading new media formats. Use 'class MyPlugin implements Loader\<...\>' when writing your custom Loader
654
- * @typeParam PluginPlayerAPIExtension - additional Player API that will be implemented by the loader. Loader at least must implement on(\<loader-name\>:attached, ...) event handler
658
+ * @typeParam PluginPlayer- Player API that will be implemented by the loader. Loader at least must implement on(\<loader-name\>:attached, ...) event handler
655
659
  */
656
- declare interface Loader<PluginOwnConfig extends KeyValue, PluginPlayerAPIExtension extends _AttachedEventCheck> extends Plugin_2<PluginOwnConfig, PlayerWith<PluginPlayerAPIExtension>> {
657
- onload(config: ConfigWith<PluginOwnConfig>, root: PlayerRoot, video: PlayerWith<PluginPlayerAPIExtension>, src?: SourceObj): void;
660
+ declare interface Loader<PluginOwnConfig extends KeyValue, // FIXME extends Config
661
+ PluginPlayer extends PlayerWith<_AttachedEventCheck>> extends Plugin_2<PluginOwnConfig, PluginPlayer> {
662
+ onload: EnsureOnAttached<(config: ConfigWith<PluginOwnConfig>, root: PlayerRoot, video: PlayerWith<PluginPlayer>, src: SourceObj) => void, PluginPlayer>;
658
663
  wants<S = SourceObj>(srcString: SourceStr, srcObj: S, config: ConfigWith<PluginOwnConfig>): boolean;
659
664
  wants<S = KeyValue>(srcString: SourceStr, srcObj: SourceWith<S>, config: ConfigWith<PluginOwnConfig>): boolean;
660
665
  }
@@ -1058,6 +1063,7 @@ declare type PlayerNativeEventsOverloads = {
1058
1063
 
1059
1064
  /**
1060
1065
  * @public
1066
+ * The root element of the video player. This is the immediate parent element of the video tag.
1061
1067
  */
1062
1068
  declare type PlayerRoot = HTMLElement & {
1063
1069
  /* Excluded from this release type: prevWidth */
@@ -1093,11 +1099,11 @@ PLAYING_2 = "playing";
1093
1099
  /**
1094
1100
  * @public
1095
1101
  */
1096
- declare interface Plugin_2<PluginConfig extends Config = Config, PluginPlayerAPI extends Player = Player> {
1102
+ declare interface Plugin_2<PluginConfig extends Config = Config, PluginPlayer extends Player = Player> {
1097
1103
  /**
1098
1104
  * a plugin must always implement the init method so a player instance knows how to initialize it
1099
1105
  */
1100
- init(config: PluginConfig, container: PlayerRoot, player: PluginPlayerAPI): void;
1106
+ init(config: PluginConfig, container: PlayerRoot, player: PluginPlayer): void;
1101
1107
  }
1102
1108
 
1103
1109
  /* Excluded from this release type: PLUGIN_REGISTERED */
@@ -1105,8 +1111,8 @@ declare interface Plugin_2<PluginConfig extends Config = Config, PluginPlayerAPI
1105
1111
  /**
1106
1112
  * @public
1107
1113
  */
1108
- declare interface PluginCtor<PluginConfig extends Config = Config, PluginPlayerAPI extends Player = Player> {
1109
- new (umd: FlowplayerUMD, player: PluginPlayerAPI): Plugin_2<PluginConfig, PluginPlayerAPI>;
1114
+ declare interface PluginCtor<PluginConfig extends Config = Config, PluginPlayer extends Player = Player> {
1115
+ new (umd: FlowplayerUMD, player: PluginPlayer): Plugin_2<PluginConfig, PluginPlayer>;
1110
1116
  }
1111
1117
 
1112
1118
  /* Excluded from this release type: PluginRegisteredEventDetail */