@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.
- package/core/events.d.ts +13 -0
- package/core/events.js +7 -2
- package/core.js +1 -1
- package/default.js +1 -1
- package/embed.js +2 -2
- package/flowplayer.css +1 -1
- package/index.d.ts +119 -25
- package/package.json +1 -1
- package/plugins/ads.d.ts +120 -26
- package/plugins/ads.js +1 -1
- package/plugins/airplay.d.ts +120 -26
- package/plugins/analytics.d.ts +120 -26
- package/plugins/analytics.js +1 -1
- package/plugins/asel.d.ts +120 -26
- package/plugins/audio.d.ts +120 -26
- package/plugins/chapters.d.ts +120 -26
- package/plugins/chromecast.d.ts +146 -34
- package/plugins/chromecast.js +1 -1
- package/plugins/comscore.d.ts +120 -26
- package/plugins/consent.d.ts +120 -26
- package/plugins/context-menu.d.ts +120 -26
- package/plugins/cuepoints.d.ts +120 -26
- package/plugins/dash.d.ts +119 -25
- package/plugins/dash.js +1 -1
- package/plugins/drm.d.ts +120 -26
- package/plugins/endscreen.d.ts +120 -26
- package/plugins/fas.d.ts +120 -26
- package/plugins/float-on-scroll.d.ts +120 -26
- package/plugins/ga4.d.ts +120 -26
- package/plugins/ga4.js +1 -1
- package/plugins/gemius.d.ts +120 -26
- package/plugins/google-analytics.d.ts +120 -26
- package/plugins/google-analytics.js +1 -1
- package/plugins/hls.d.ts +120 -26
- package/plugins/hls.js +1 -1
- package/plugins/id3.d.ts +120 -26
- package/plugins/iframe.d.ts +119 -25
- package/plugins/keyboard.d.ts +120 -26
- package/plugins/media-session.d.ts +120 -26
- package/plugins/message.d.ts +120 -26
- package/plugins/ovp.d.ts +120 -26
- package/plugins/playlist.d.ts +125 -26
- package/plugins/playlist.js +1 -1
- package/plugins/preview.d.ts +120 -26
- package/plugins/qsel.d.ts +120 -26
- package/plugins/qsel.js +1 -1
- package/plugins/qul.d.ts +120 -26
- package/plugins/rts.d.ts +120 -26
- package/plugins/rts.js +2 -2
- package/plugins/share.d.ts +153 -26
- package/plugins/speed.d.ts +141 -30
- package/plugins/ssai.d.ts +120 -28
- package/plugins/ssai.js +2 -2
- package/plugins/subtitles.d.ts +120 -26
- package/plugins/thumbnails.d.ts +135 -30
- package/plugins/tizen.d.ts +120 -26
- package/plugins/vtsel.d.ts +119 -26
- package/plugins/webos.d.ts +120 -26
- package/util/loader.d.ts +120 -26
- package/util/loader.js +0 -1
package/plugins/drm.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
|
/**
|
|
@@ -237,7 +265,7 @@ declare const DISABLED = "is-disabled";
|
|
|
237
265
|
/**
|
|
238
266
|
* @public
|
|
239
267
|
*/
|
|
240
|
-
declare const DRM: PluginCtor<
|
|
268
|
+
declare const DRM: PluginCtor<NoInfer<Config>, NoInfer<Player>>;
|
|
241
269
|
export default DRM;
|
|
242
270
|
|
|
243
271
|
/**
|
|
@@ -388,6 +416,7 @@ declare namespace events {
|
|
|
388
416
|
SOURCE,
|
|
389
417
|
REAP,
|
|
390
418
|
QUALITIES,
|
|
419
|
+
QUALITY_CHANGE,
|
|
391
420
|
VIDEO_TRACKS,
|
|
392
421
|
SET_QUALITY,
|
|
393
422
|
VIDEO_TRACK_SELECT,
|
|
@@ -403,8 +432,20 @@ declare namespace events {
|
|
|
403
432
|
}
|
|
404
433
|
}
|
|
405
434
|
|
|
435
|
+
declare type ExtractBareConfig<Plugins extends PluginCtor> = Plugins extends PluginCtor<ConfigWith<infer ConfigType>> ? ConfigType : never;
|
|
436
|
+
|
|
437
|
+
declare type ExtractPluginPlayerExtension<Plugin extends PluginCtor> = Plugin extends PluginCtor<infer _uConfigType, PlayerWith<infer PluginPlayer>> ? PluginPlayer : never;
|
|
438
|
+
|
|
406
439
|
declare type ExtractPureAPI<T> = T extends PlayerWith<infer PureAPI> ? PureAPI : never;
|
|
407
440
|
|
|
441
|
+
declare type ExtractSrcExtension<PluginBareConfig> = Get<PluginBareConfig, "src"> extends UnsafeSource<infer SrcMixinType> ? SrcMixinType : never;
|
|
442
|
+
|
|
443
|
+
declare type FilterNewSourceTypes<PluginSrcs extends unknown[]> = {
|
|
444
|
+
[Index in keyof PluginSrcs]: PluginSrcs[Index] extends {
|
|
445
|
+
type: string;
|
|
446
|
+
} ? PluginSrcs[Index] : never;
|
|
447
|
+
};
|
|
448
|
+
|
|
408
449
|
/**
|
|
409
450
|
* @public
|
|
410
451
|
*/
|
|
@@ -447,7 +488,7 @@ declare interface FlowplayerUMD extends FlowplayerUMDBase {
|
|
|
447
488
|
* Register plugins in flowplayer
|
|
448
489
|
* @returns flowplayer instance with registered plugins
|
|
449
490
|
*/
|
|
450
|
-
<PluginCtors extends PluginCtor[]>(...plugins: PluginCtors): FlowplayerUMDWithPlugins<
|
|
491
|
+
<PluginCtors extends PluginCtor[]>(...plugins: PluginCtors): FlowplayerUMDWithPlugins<MergeConfigs<PluginCtors>, PlayerWith<MergePlayerExtensions<PluginCtors>>>;
|
|
451
492
|
}
|
|
452
493
|
|
|
453
494
|
declare interface FlowplayerUMDBase {
|
|
@@ -548,6 +589,10 @@ declare const GRABBING = "is-grabbing";
|
|
|
548
589
|
|
|
549
590
|
declare const HAS_POSTER = "has-poster";
|
|
550
591
|
|
|
592
|
+
declare type HasGlobalSrcExtensios<PluginSrcs extends unknown[]> = ArrayToIntersection<PickGlobalSrcExtension<PluginSrcs>>;
|
|
593
|
+
|
|
594
|
+
declare type HasSrcExtensions<PluginBareConfigs extends unknown[]> = TupleToUnion<PickSrcExtensions<PluginBareConfigs>> extends never ? false : true;
|
|
595
|
+
|
|
551
596
|
declare const HOVERED = "is-hovered";
|
|
552
597
|
|
|
553
598
|
declare const IN_VIEWPORT = "is-in-viewport";
|
|
@@ -657,19 +702,24 @@ PluginPlayer extends PlayerWith<_AttachedEventCheck>> extends Plugin_2<PluginOwn
|
|
|
657
702
|
|
|
658
703
|
declare const LOADING = "is-loading";
|
|
659
704
|
|
|
660
|
-
declare type
|
|
661
|
-
[PluginType in keyof
|
|
705
|
+
declare type MapToBareConfigs<Plugins extends PluginCtor[]> = {
|
|
706
|
+
[PluginType in keyof Plugins]: ExtractBareConfig<Plugins[PluginType]>;
|
|
662
707
|
};
|
|
663
708
|
|
|
664
|
-
declare type
|
|
665
|
-
[
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
1148
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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/endscreen.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
|
/**
|
|
@@ -314,7 +342,7 @@ ENDED_2 = "ended";
|
|
|
314
342
|
/**
|
|
315
343
|
* @public
|
|
316
344
|
*/
|
|
317
|
-
declare const Endscreen: PluginCtor<Config
|
|
345
|
+
declare const Endscreen: PluginCtor<NoInfer<Config>, NoInfer<Player>>;
|
|
318
346
|
export default Endscreen;
|
|
319
347
|
|
|
320
348
|
/**
|
|
@@ -395,6 +423,7 @@ declare namespace events {
|
|
|
395
423
|
SOURCE,
|
|
396
424
|
REAP,
|
|
397
425
|
QUALITIES,
|
|
426
|
+
QUALITY_CHANGE,
|
|
398
427
|
VIDEO_TRACKS,
|
|
399
428
|
SET_QUALITY,
|
|
400
429
|
VIDEO_TRACK_SELECT,
|
|
@@ -410,8 +439,20 @@ declare namespace events {
|
|
|
410
439
|
}
|
|
411
440
|
}
|
|
412
441
|
|
|
442
|
+
declare type ExtractBareConfig<Plugins extends PluginCtor> = Plugins extends PluginCtor<ConfigWith<infer ConfigType>> ? ConfigType : never;
|
|
443
|
+
|
|
444
|
+
declare type ExtractPluginPlayerExtension<Plugin extends PluginCtor> = Plugin extends PluginCtor<infer _uConfigType, PlayerWith<infer PluginPlayer>> ? PluginPlayer : never;
|
|
445
|
+
|
|
413
446
|
declare type ExtractPureAPI<T> = T extends PlayerWith<infer PureAPI> ? PureAPI : never;
|
|
414
447
|
|
|
448
|
+
declare type ExtractSrcExtension<PluginBareConfig> = Get<PluginBareConfig, "src"> extends UnsafeSource<infer SrcMixinType> ? SrcMixinType : never;
|
|
449
|
+
|
|
450
|
+
declare type FilterNewSourceTypes<PluginSrcs extends unknown[]> = {
|
|
451
|
+
[Index in keyof PluginSrcs]: PluginSrcs[Index] extends {
|
|
452
|
+
type: string;
|
|
453
|
+
} ? PluginSrcs[Index] : never;
|
|
454
|
+
};
|
|
455
|
+
|
|
415
456
|
/**
|
|
416
457
|
* @public
|
|
417
458
|
*/
|
|
@@ -454,7 +495,7 @@ declare interface FlowplayerUMD extends FlowplayerUMDBase {
|
|
|
454
495
|
* Register plugins in flowplayer
|
|
455
496
|
* @returns flowplayer instance with registered plugins
|
|
456
497
|
*/
|
|
457
|
-
<PluginCtors extends PluginCtor[]>(...plugins: PluginCtors): FlowplayerUMDWithPlugins<
|
|
498
|
+
<PluginCtors extends PluginCtor[]>(...plugins: PluginCtors): FlowplayerUMDWithPlugins<MergeConfigs<PluginCtors>, PlayerWith<MergePlayerExtensions<PluginCtors>>>;
|
|
458
499
|
}
|
|
459
500
|
|
|
460
501
|
declare interface FlowplayerUMDBase {
|
|
@@ -555,6 +596,10 @@ declare const GRABBING = "is-grabbing";
|
|
|
555
596
|
|
|
556
597
|
declare const HAS_POSTER = "has-poster";
|
|
557
598
|
|
|
599
|
+
declare type HasGlobalSrcExtensios<PluginSrcs extends unknown[]> = ArrayToIntersection<PickGlobalSrcExtension<PluginSrcs>>;
|
|
600
|
+
|
|
601
|
+
declare type HasSrcExtensions<PluginBareConfigs extends unknown[]> = TupleToUnion<PickSrcExtensions<PluginBareConfigs>> extends never ? false : true;
|
|
602
|
+
|
|
558
603
|
declare const HOVERED = "is-hovered";
|
|
559
604
|
|
|
560
605
|
declare const IN_VIEWPORT = "is-in-viewport";
|
|
@@ -664,19 +709,24 @@ PluginPlayer extends PlayerWith<_AttachedEventCheck>> extends Plugin_2<PluginOwn
|
|
|
664
709
|
|
|
665
710
|
declare const LOADING = "is-loading";
|
|
666
711
|
|
|
667
|
-
declare type
|
|
668
|
-
[PluginType in keyof
|
|
712
|
+
declare type MapToBareConfigs<Plugins extends PluginCtor[]> = {
|
|
713
|
+
[PluginType in keyof Plugins]: ExtractBareConfig<Plugins[PluginType]>;
|
|
669
714
|
};
|
|
670
715
|
|
|
671
|
-
declare type
|
|
672
|
-
[
|
|
716
|
+
declare type MapToPlayerExtensions<Plugins extends PluginCtor[]> = {
|
|
717
|
+
[PluginIndex in keyof Plugins]: ExtractPluginPlayerExtension<Plugins[PluginIndex]>;
|
|
673
718
|
};
|
|
674
719
|
|
|
675
720
|
declare const MENU_OPENED = "has-menu-opened";
|
|
676
721
|
|
|
677
|
-
|
|
722
|
+
/**
|
|
723
|
+
* Combines plugin config and returns a type derived from Config
|
|
724
|
+
*/
|
|
725
|
+
declare type MergeConfigs<Plugins extends PluginCtor[]> = MergePluginConfigs<MapToBareConfigs<Plugins>>;
|
|
726
|
+
|
|
727
|
+
declare type MergePlayerExtensions<Plugins extends PluginCtor[]> = ArrayToIntersection<MapToPlayerExtensions<Plugins>>;
|
|
678
728
|
|
|
679
|
-
declare type
|
|
729
|
+
declare type MergePluginConfigs<PluginBareConfigs extends unknown[]> = HasSrcExtensions<PluginBareConfigs> extends true ? ConfigWithSourceExtensions<PluginBareConfigs> : ConfigWith<ArrayToIntersection<PluginBareConfigs>>;
|
|
680
730
|
|
|
681
731
|
/**
|
|
682
732
|
* @public
|
|
@@ -771,8 +821,6 @@ declare const NO_CONTROLS = "no-controls";
|
|
|
771
821
|
|
|
772
822
|
declare const NO_DVR = "no-timeline";
|
|
773
823
|
|
|
774
|
-
declare type NoInfer_2<T> = [T][T extends any ? 0 : never];
|
|
775
|
-
|
|
776
824
|
/* Excluded from this release type: NON_RECOVERABLE_ERROR */
|
|
777
825
|
|
|
778
826
|
/* Excluded from this release type: NonRecoverableErrorEventDetail */
|
|
@@ -791,6 +839,7 @@ declare type OVPMetadata = {
|
|
|
791
839
|
category_name?: string;
|
|
792
840
|
duration?: number;
|
|
793
841
|
tags?: string;
|
|
842
|
+
playlist_title?: string;
|
|
794
843
|
};
|
|
795
844
|
|
|
796
845
|
/**
|
|
@@ -806,6 +855,26 @@ PAUSE = "pause";
|
|
|
806
855
|
|
|
807
856
|
declare const PAUSED = "is-paused";
|
|
808
857
|
|
|
858
|
+
declare type PickGlobalSrcExtension<PluginSrcs extends unknown[]> = {
|
|
859
|
+
[Index in keyof PluginSrcs]: PluginSrcs[Index] extends {
|
|
860
|
+
type: string;
|
|
861
|
+
} ? unknown : PluginSrcs[Index];
|
|
862
|
+
};
|
|
863
|
+
|
|
864
|
+
/**
|
|
865
|
+
* Maps incoming array to the src extension type
|
|
866
|
+
* @example
|
|
867
|
+
* ```
|
|
868
|
+
* PickSrcExtensions<[
|
|
869
|
+
* {configProp: boolean, src: UnsafeSource<{srcProp: boolean}>},
|
|
870
|
+
* {}
|
|
871
|
+
* ]> // = [{srcProp: boolean}, never]
|
|
872
|
+
* ```
|
|
873
|
+
*/
|
|
874
|
+
declare type PickSrcExtensions<PluginBareConfigs extends unknown[]> = {
|
|
875
|
+
[PluginType in keyof PluginBareConfigs]: ExtractSrcExtension<PluginBareConfigs[PluginType]>;
|
|
876
|
+
};
|
|
877
|
+
|
|
809
878
|
/**
|
|
810
879
|
* @public
|
|
811
880
|
*/
|
|
@@ -927,6 +996,8 @@ declare type PlayerCustomEventsDetailMap = PlayerEmittableCustomEventsDetailMap
|
|
|
927
996
|
[DVR]: DvrEventDetail;
|
|
928
997
|
[RETRY]: RetryEventDetail;
|
|
929
998
|
[RECOVER]: RecoverEventDetail;
|
|
999
|
+
[QUALITIES]: QualitiesEventDetail;
|
|
1000
|
+
[QUALITY_CHANGE]: QualityChangeEventDetail;
|
|
930
1001
|
/* Excluded from this release type: audioonlysource */
|
|
931
1002
|
/* Excluded from this release type: renderplugin */
|
|
932
1003
|
/* Excluded from this release type: "seek:queued" */
|
|
@@ -983,7 +1054,10 @@ declare type PlayerCustomEventsOverloads = {
|
|
|
983
1054
|
* Emitted when the set of underlying qualities has changed.
|
|
984
1055
|
*/
|
|
985
1056
|
on(event: typeof QUALITIES, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof QUALITIES]>) => void): Player;
|
|
986
|
-
|
|
1057
|
+
/**
|
|
1058
|
+
* Emitted when the media changes quality.
|
|
1059
|
+
*/
|
|
1060
|
+
on(event: typeof QUALITY_CHANGE, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof QUALITY_CHANGE]>) => void): Player;
|
|
987
1061
|
/* Excluded from this release type: on */
|
|
988
1062
|
/**
|
|
989
1063
|
* Listen to this event to create a recommendations grid using the data passed with the event.
|
|
@@ -1038,7 +1112,6 @@ declare type PlayerCustomEventsOverloads = {
|
|
|
1038
1112
|
/* Excluded from this release type: emit */
|
|
1039
1113
|
/* Excluded from this release type: emit */
|
|
1040
1114
|
/* Excluded from this release type: emit */
|
|
1041
|
-
/* Excluded from this release type: emit */
|
|
1042
1115
|
};
|
|
1043
1116
|
|
|
1044
1117
|
declare type PlayerEmittableCustomEventsDetailMap = {
|
|
@@ -1046,7 +1119,6 @@ declare type PlayerEmittableCustomEventsDetailMap = {
|
|
|
1046
1119
|
[CONTEXT_MENU]: ContextMenuEventDetail;
|
|
1047
1120
|
[VIEW_ENTER]: ViewEnterEventDetail;
|
|
1048
1121
|
[VIEW_LEAVE]: ViewLeaveEventDetail;
|
|
1049
|
-
[QUALITIES]: QualitiesEventDetail;
|
|
1050
1122
|
[RECOMMENDATIONS_READY]: RecommendationsReadyEventDetail;
|
|
1051
1123
|
};
|
|
1052
1124
|
|
|
@@ -1155,11 +1227,16 @@ PROGRESS = "progress";
|
|
|
1155
1227
|
/**
|
|
1156
1228
|
* @public
|
|
1157
1229
|
*/
|
|
1158
|
-
declare type QselOption = {
|
|
1159
|
-
height: number;
|
|
1230
|
+
declare type QselOption = (Level & {
|
|
1160
1231
|
level: number;
|
|
1161
|
-
|
|
1162
|
-
|
|
1232
|
+
}) | BitrateInfo | {
|
|
1233
|
+
name: string | number;
|
|
1234
|
+
encodingId: string;
|
|
1235
|
+
spatialLayerId: number;
|
|
1236
|
+
temporalLayerId: number;
|
|
1237
|
+
maxSpatialLayerId: number;
|
|
1238
|
+
maxTemporalLayerId: number;
|
|
1239
|
+
height: number;
|
|
1163
1240
|
width: number;
|
|
1164
1241
|
};
|
|
1165
1242
|
|
|
@@ -1183,9 +1260,29 @@ QUALITIES = "qualities";
|
|
|
1183
1260
|
*/
|
|
1184
1261
|
declare type QualitiesEventDetail = QselOption[];
|
|
1185
1262
|
|
|
1186
|
-
|
|
1263
|
+
/**
|
|
1264
|
+
* @public
|
|
1265
|
+
* emitted whenever the media changes quality
|
|
1266
|
+
*/
|
|
1267
|
+
declare const /**
|
|
1268
|
+
@public
|
|
1269
|
+
* when a new player is inserted into the HTML
|
|
1270
|
+
*/ /**
|
|
1271
|
+
* @public
|
|
1272
|
+
* emitted whenever the media changes quality
|
|
1273
|
+
*/
|
|
1274
|
+
QUALITY_CHANGE = "qualitychange";
|
|
1187
1275
|
|
|
1188
|
-
|
|
1276
|
+
/**
|
|
1277
|
+
* @public
|
|
1278
|
+
*/
|
|
1279
|
+
declare type QualityChangeEventDetail = {
|
|
1280
|
+
before: Level | BitrateInfo;
|
|
1281
|
+
after: Level | BitrateInfo;
|
|
1282
|
+
plugin: string;
|
|
1283
|
+
automatic: boolean;
|
|
1284
|
+
downscale: boolean;
|
|
1285
|
+
};
|
|
1189
1286
|
|
|
1190
1287
|
declare enum QualityOpts {
|
|
1191
1288
|
LOW = 1,
|
|
@@ -1396,14 +1493,14 @@ declare type SourceEventDetail = SourceObj;
|
|
|
1396
1493
|
/**
|
|
1397
1494
|
* @public
|
|
1398
1495
|
*/
|
|
1399
|
-
declare type SourceObj = {
|
|
1496
|
+
declare type SourceObj<T = unknown> = {
|
|
1400
1497
|
src?: SourceStr;
|
|
1401
1498
|
/**
|
|
1402
1499
|
* the MIME type (example `video/mp4` or `application/x-mpegurl`)
|
|
1403
1500
|
*/
|
|
1404
1501
|
type?: string;
|
|
1405
1502
|
drm?: DRMSourceConfiguration;
|
|
1406
|
-
};
|
|
1503
|
+
} & T;
|
|
1407
1504
|
|
|
1408
1505
|
/**
|
|
1409
1506
|
* @public
|
|
@@ -1530,7 +1627,7 @@ declare const TV = "is-tv";
|
|
|
1530
1627
|
/**
|
|
1531
1628
|
* @public
|
|
1532
1629
|
*/
|
|
1533
|
-
declare type UnsafeSource = SourceStr | SourceObj | Array<SourceStr | SourceObj
|
|
1630
|
+
declare type UnsafeSource<SrcMixin = unknown> = SourceStr | SourceObj<SrcMixin> | Array<SourceStr | SourceObj<SrcMixin>>;
|
|
1534
1631
|
|
|
1535
1632
|
/**
|
|
1536
1633
|
* @public
|
|
@@ -1626,9 +1723,6 @@ declare const WILL_PLAY = "will-play";
|
|
|
1626
1723
|
|
|
1627
1724
|
declare const WILL_SEEK = "will-seek";
|
|
1628
1725
|
|
|
1629
|
-
declare type WithOpts<PluginPlayer extends Player = Player, PluginConfig extends Config = Config> = PluginPlayer
|
|
1630
|
-
opts: PluginConfig;
|
|
1631
|
-
setOpts(config: PluginConfig): void;
|
|
1632
|
-
};
|
|
1726
|
+
declare type WithOpts<PluginPlayer extends Player = Player, PluginConfig extends Config = Config> = SetFieldType<SetFieldType<PluginPlayer, "opts", PluginConfig>, "setOpts", (config: PluginConfig) => void>;
|
|
1633
1727
|
|
|
1634
1728
|
export { }
|