@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.
- package/core.js +1 -1
- package/default.js +1 -1
- package/embed.js +2 -2
- package/index.d.ts +16 -10
- package/package.json +1 -1
- package/plugins/ads.d.ts +19 -13
- package/plugins/ads.js +1 -1
- package/plugins/airplay.d.ts +19 -13
- package/plugins/analytics.d.ts +16 -10
- package/plugins/analytics.js +1 -1
- package/plugins/asel.d.ts +16 -10
- package/plugins/audio.d.ts +16 -10
- package/plugins/chapters.d.ts +16 -10
- package/plugins/chromecast.d.ts +16 -10
- package/plugins/comscore.d.ts +16 -10
- package/plugins/consent.d.ts +16 -10
- package/plugins/context-menu.d.ts +17 -11
- package/plugins/cuepoints.d.ts +17 -11
- package/plugins/dash.d.ts +23 -15
- package/plugins/drm.d.ts +16 -10
- package/plugins/endscreen.d.ts +16 -10
- package/plugins/fas.d.ts +16 -10
- package/plugins/float-on-scroll.d.ts +16 -10
- package/plugins/ga4.d.ts +16 -10
- package/plugins/gemius.d.ts +16 -10
- package/plugins/google-analytics.d.ts +16 -10
- package/plugins/health.d.ts +22 -13
- package/plugins/health.js +1 -1
- package/plugins/hls.d.ts +19 -13
- package/plugins/id3.d.ts +16 -10
- package/plugins/iframe.d.ts +16 -10
- package/plugins/keyboard.d.ts +16 -10
- package/plugins/media-session.d.ts +16 -10
- package/plugins/message.d.ts +16 -10
- package/plugins/ovp.d.ts +31 -24
- package/plugins/ovp.js +1 -1
- package/plugins/playlist.d.ts +16 -10
- package/plugins/preview.d.ts +16 -10
- package/plugins/qsel.d.ts +16 -10
- package/plugins/qul.d.ts +16 -10
- package/plugins/rts.d.ts +16 -10
- package/plugins/share.d.ts +16 -10
- package/plugins/speed.d.ts +16 -10
- package/plugins/ssai.d.ts +16 -10
- package/plugins/ssai.js +1 -1
- package/plugins/subtitles.d.ts +19 -13
- package/plugins/thumbnails.d.ts +16 -10
- package/plugins/tizen.d.ts +16 -10
- package/plugins/vtsel.d.ts +16 -10
- package/plugins/webos.d.ts +16 -10
- package/util/loader.d.ts +18 -12
package/plugins/vtsel.d.ts
CHANGED
|
@@ -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,
|
|
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):
|
|
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):
|
|
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
|
|
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,
|
|
644
|
-
|
|
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,
|
|
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:
|
|
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,
|
|
1089
|
-
new (umd: FlowplayerUMD, player:
|
|
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/plugins/webos.d.ts
CHANGED
|
@@ -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,
|
|
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):
|
|
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):
|
|
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
|
|
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,
|
|
644
|
-
|
|
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,
|
|
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:
|
|
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,
|
|
1089
|
-
new (umd: FlowplayerUMD, player:
|
|
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,
|
|
241
|
-
plugin: PluginCtor<NoInfer<PluginConfig>, NoInfer<
|
|
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,
|
|
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):
|
|
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):
|
|
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
|
|
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,
|
|
657
|
-
|
|
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,
|
|
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:
|
|
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,
|
|
1109
|
-
new (umd: FlowplayerUMD, player:
|
|
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 */
|