@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/keyboard.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<
|
|
485
|
+
<PluginCtors extends PluginCtor[]>(...plugins: PluginCtors): FlowplayerUMDWithPlugins<MergeConfigs<PluginCtors>, PlayerWith<MergePlayerExtensions<PluginCtors>>>;
|
|
445
486
|
}
|
|
446
487
|
|
|
447
488
|
declare interface FlowplayerUMDBase {
|
|
@@ -542,6 +583,10 @@ declare const GRABBING = "is-grabbing";
|
|
|
542
583
|
|
|
543
584
|
declare const HAS_POSTER = "has-poster";
|
|
544
585
|
|
|
586
|
+
declare type HasGlobalSrcExtensios<PluginSrcs extends unknown[]> = ArrayToIntersection<PickGlobalSrcExtension<PluginSrcs>>;
|
|
587
|
+
|
|
588
|
+
declare type HasSrcExtensions<PluginBareConfigs extends unknown[]> = TupleToUnion<PickSrcExtensions<PluginBareConfigs>> extends never ? false : true;
|
|
589
|
+
|
|
545
590
|
declare const HOVERED = "is-hovered";
|
|
546
591
|
|
|
547
592
|
declare const IN_VIEWPORT = "is-in-viewport";
|
|
@@ -557,7 +602,7 @@ declare type JSONPlayer = any;
|
|
|
557
602
|
/**
|
|
558
603
|
* @public
|
|
559
604
|
*/
|
|
560
|
-
declare const Keyboard: PluginCtor<Config
|
|
605
|
+
declare const Keyboard: PluginCtor<NoInfer<Config>, NoInfer<Player>>;
|
|
561
606
|
export default Keyboard;
|
|
562
607
|
|
|
563
608
|
/**
|
|
@@ -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 { }
|
|
@@ -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<
|
|
485
|
+
<PluginCtors extends PluginCtor[]>(...plugins: PluginCtors): FlowplayerUMDWithPlugins<MergeConfigs<PluginCtors>, PlayerWith<MergePlayerExtensions<PluginCtors>>>;
|
|
445
486
|
}
|
|
446
487
|
|
|
447
488
|
declare interface FlowplayerUMDBase {
|
|
@@ -542,6 +583,10 @@ declare const GRABBING = "is-grabbing";
|
|
|
542
583
|
|
|
543
584
|
declare const HAS_POSTER = "has-poster";
|
|
544
585
|
|
|
586
|
+
declare type HasGlobalSrcExtensios<PluginSrcs extends unknown[]> = ArrayToIntersection<PickGlobalSrcExtension<PluginSrcs>>;
|
|
587
|
+
|
|
588
|
+
declare type HasSrcExtensions<PluginBareConfigs extends unknown[]> = TupleToUnion<PickSrcExtensions<PluginBareConfigs>> extends never ? false : true;
|
|
589
|
+
|
|
545
590
|
declare const HOVERED = "is-hovered";
|
|
546
591
|
|
|
547
592
|
declare const IN_VIEWPORT = "is-in-viewport";
|
|
@@ -651,25 +696,30 @@ PluginPlayer extends PlayerWith<_AttachedEventCheck>> extends Plugin_2<PluginOwn
|
|
|
651
696
|
|
|
652
697
|
declare const LOADING = "is-loading";
|
|
653
698
|
|
|
654
|
-
declare type
|
|
655
|
-
[PluginType in keyof
|
|
699
|
+
declare type MapToBareConfigs<Plugins extends PluginCtor[]> = {
|
|
700
|
+
[PluginType in keyof Plugins]: ExtractBareConfig<Plugins[PluginType]>;
|
|
656
701
|
};
|
|
657
702
|
|
|
658
|
-
declare type
|
|
659
|
-
[
|
|
703
|
+
declare type MapToPlayerExtensions<Plugins extends PluginCtor[]> = {
|
|
704
|
+
[PluginIndex in keyof Plugins]: ExtractPluginPlayerExtension<Plugins[PluginIndex]>;
|
|
660
705
|
};
|
|
661
706
|
|
|
662
707
|
/**
|
|
663
708
|
* @public
|
|
664
709
|
*/
|
|
665
|
-
declare const MediaSessionPlugin: PluginCtor<Config
|
|
710
|
+
declare const MediaSessionPlugin: PluginCtor<NoInfer<Config>, NoInfer<Player>>;
|
|
666
711
|
export default MediaSessionPlugin;
|
|
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 { }
|