@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/id3.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,
|
|
@@ -403,8 +432,20 @@ declare namespace events_2 {
|
|
|
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
|
/**
|
|
@@ -555,7 +600,7 @@ declare const HOVERED = "is-hovered";
|
|
|
555
600
|
* This plugin adds support for ID3 metadata tags.
|
|
556
601
|
* See {@link https://developer.wowza.com/docs/wowza-flowplayer/plugins/id3-metadata/ | Official documentation}
|
|
557
602
|
*/
|
|
558
|
-
declare const ID3: PluginCtor<Config
|
|
603
|
+
declare const ID3: PluginCtor<NoInfer<Config>, NoInfer<ID3Player>> & NoInfer<ID3API>;
|
|
559
604
|
export default ID3;
|
|
560
605
|
|
|
561
606
|
declare const ID3_2 = "ID3";
|
|
@@ -723,19 +768,24 @@ PluginPlayer extends PlayerWith<_AttachedEventCheck>> extends Plugin_2<PluginOwn
|
|
|
723
768
|
|
|
724
769
|
declare const LOADING = "is-loading";
|
|
725
770
|
|
|
726
|
-
declare type
|
|
727
|
-
[PluginType in keyof
|
|
771
|
+
declare type MapToBareConfigs<Plugins extends PluginCtor[]> = {
|
|
772
|
+
[PluginType in keyof Plugins]: ExtractBareConfig<Plugins[PluginType]>;
|
|
728
773
|
};
|
|
729
774
|
|
|
730
|
-
declare type
|
|
731
|
-
[
|
|
775
|
+
declare type MapToPlayerExtensions<Plugins extends PluginCtor[]> = {
|
|
776
|
+
[PluginIndex in keyof Plugins]: ExtractPluginPlayerExtension<Plugins[PluginIndex]>;
|
|
732
777
|
};
|
|
733
778
|
|
|
734
779
|
declare const MENU_OPENED = "has-menu-opened";
|
|
735
780
|
|
|
736
|
-
|
|
781
|
+
/**
|
|
782
|
+
* Combines plugin config and returns a type derived from Config
|
|
783
|
+
*/
|
|
784
|
+
declare type MergeConfigs<Plugins extends PluginCtor[]> = MergePluginConfigs<MapToBareConfigs<Plugins>>;
|
|
785
|
+
|
|
786
|
+
declare type MergePlayerExtensions<Plugins extends PluginCtor[]> = ArrayToIntersection<MapToPlayerExtensions<Plugins>>;
|
|
737
787
|
|
|
738
|
-
declare type
|
|
788
|
+
declare type MergePluginConfigs<PluginBareConfigs extends unknown[]> = HasSrcExtensions<PluginBareConfigs> extends true ? ConfigWithSourceExtensions<PluginBareConfigs> : ConfigWith<ArrayToIntersection<PluginBareConfigs>>;
|
|
739
789
|
|
|
740
790
|
/**
|
|
741
791
|
* @public
|
|
@@ -830,8 +880,6 @@ declare const NO_CONTROLS = "no-controls";
|
|
|
830
880
|
|
|
831
881
|
declare const NO_DVR = "no-timeline";
|
|
832
882
|
|
|
833
|
-
declare type NoInfer_2<T> = [T][T extends any ? 0 : never];
|
|
834
|
-
|
|
835
883
|
/* Excluded from this release type: NON_RECOVERABLE_ERROR */
|
|
836
884
|
|
|
837
885
|
/* Excluded from this release type: NonRecoverableErrorEventDetail */
|
|
@@ -850,6 +898,7 @@ declare type OVPMetadata = {
|
|
|
850
898
|
category_name?: string;
|
|
851
899
|
duration?: number;
|
|
852
900
|
tags?: string;
|
|
901
|
+
playlist_title?: string;
|
|
853
902
|
};
|
|
854
903
|
|
|
855
904
|
/**
|
|
@@ -865,6 +914,26 @@ PAUSE = "pause";
|
|
|
865
914
|
|
|
866
915
|
declare const PAUSED = "is-paused";
|
|
867
916
|
|
|
917
|
+
declare type PickGlobalSrcExtension<PluginSrcs extends unknown[]> = {
|
|
918
|
+
[Index in keyof PluginSrcs]: PluginSrcs[Index] extends {
|
|
919
|
+
type: string;
|
|
920
|
+
} ? unknown : PluginSrcs[Index];
|
|
921
|
+
};
|
|
922
|
+
|
|
923
|
+
/**
|
|
924
|
+
* Maps incoming array to the src extension type
|
|
925
|
+
* @example
|
|
926
|
+
* ```
|
|
927
|
+
* PickSrcExtensions<[
|
|
928
|
+
* {configProp: boolean, src: UnsafeSource<{srcProp: boolean}>},
|
|
929
|
+
* {}
|
|
930
|
+
* ]> // = [{srcProp: boolean}, never]
|
|
931
|
+
* ```
|
|
932
|
+
*/
|
|
933
|
+
declare type PickSrcExtensions<PluginBareConfigs extends unknown[]> = {
|
|
934
|
+
[PluginType in keyof PluginBareConfigs]: ExtractSrcExtension<PluginBareConfigs[PluginType]>;
|
|
935
|
+
};
|
|
936
|
+
|
|
868
937
|
/**
|
|
869
938
|
* @public
|
|
870
939
|
*/
|
|
@@ -986,6 +1055,8 @@ declare type PlayerCustomEventsDetailMap = PlayerEmittableCustomEventsDetailMap
|
|
|
986
1055
|
[DVR]: DvrEventDetail;
|
|
987
1056
|
[RETRY]: RetryEventDetail;
|
|
988
1057
|
[RECOVER]: RecoverEventDetail;
|
|
1058
|
+
[QUALITIES]: QualitiesEventDetail;
|
|
1059
|
+
[QUALITY_CHANGE]: QualityChangeEventDetail;
|
|
989
1060
|
/* Excluded from this release type: audioonlysource */
|
|
990
1061
|
/* Excluded from this release type: renderplugin */
|
|
991
1062
|
/* Excluded from this release type: "seek:queued" */
|
|
@@ -1042,7 +1113,10 @@ declare type PlayerCustomEventsOverloads = {
|
|
|
1042
1113
|
* Emitted when the set of underlying qualities has changed.
|
|
1043
1114
|
*/
|
|
1044
1115
|
on(event: typeof QUALITIES, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof QUALITIES]>) => void): Player;
|
|
1045
|
-
|
|
1116
|
+
/**
|
|
1117
|
+
* Emitted when the media changes quality.
|
|
1118
|
+
*/
|
|
1119
|
+
on(event: typeof QUALITY_CHANGE, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof QUALITY_CHANGE]>) => void): Player;
|
|
1046
1120
|
/* Excluded from this release type: on */
|
|
1047
1121
|
/**
|
|
1048
1122
|
* Listen to this event to create a recommendations grid using the data passed with the event.
|
|
@@ -1097,7 +1171,6 @@ declare type PlayerCustomEventsOverloads = {
|
|
|
1097
1171
|
/* Excluded from this release type: emit */
|
|
1098
1172
|
/* Excluded from this release type: emit */
|
|
1099
1173
|
/* Excluded from this release type: emit */
|
|
1100
|
-
/* Excluded from this release type: emit */
|
|
1101
1174
|
};
|
|
1102
1175
|
|
|
1103
1176
|
declare type PlayerEmittableCustomEventsDetailMap = {
|
|
@@ -1105,7 +1178,6 @@ declare type PlayerEmittableCustomEventsDetailMap = {
|
|
|
1105
1178
|
[CONTEXT_MENU]: ContextMenuEventDetail;
|
|
1106
1179
|
[VIEW_ENTER]: ViewEnterEventDetail;
|
|
1107
1180
|
[VIEW_LEAVE]: ViewLeaveEventDetail;
|
|
1108
|
-
[QUALITIES]: QualitiesEventDetail;
|
|
1109
1181
|
[RECOMMENDATIONS_READY]: RecommendationsReadyEventDetail;
|
|
1110
1182
|
};
|
|
1111
1183
|
|
|
@@ -1207,11 +1279,16 @@ PROGRESS = "progress";
|
|
|
1207
1279
|
/**
|
|
1208
1280
|
* @public
|
|
1209
1281
|
*/
|
|
1210
|
-
declare type QselOption = {
|
|
1211
|
-
height: number;
|
|
1282
|
+
declare type QselOption = (Level & {
|
|
1212
1283
|
level: number;
|
|
1213
|
-
|
|
1214
|
-
|
|
1284
|
+
}) | BitrateInfo | {
|
|
1285
|
+
name: string | number;
|
|
1286
|
+
encodingId: string;
|
|
1287
|
+
spatialLayerId: number;
|
|
1288
|
+
temporalLayerId: number;
|
|
1289
|
+
maxSpatialLayerId: number;
|
|
1290
|
+
maxTemporalLayerId: number;
|
|
1291
|
+
height: number;
|
|
1215
1292
|
width: number;
|
|
1216
1293
|
};
|
|
1217
1294
|
|
|
@@ -1235,9 +1312,29 @@ QUALITIES = "qualities";
|
|
|
1235
1312
|
*/
|
|
1236
1313
|
declare type QualitiesEventDetail = QselOption[];
|
|
1237
1314
|
|
|
1238
|
-
|
|
1315
|
+
/**
|
|
1316
|
+
* @public
|
|
1317
|
+
* emitted whenever the media changes quality
|
|
1318
|
+
*/
|
|
1319
|
+
declare const /**
|
|
1320
|
+
@public
|
|
1321
|
+
* when a new player is inserted into the HTML
|
|
1322
|
+
*/ /**
|
|
1323
|
+
* @public
|
|
1324
|
+
* emitted whenever the media changes quality
|
|
1325
|
+
*/
|
|
1326
|
+
QUALITY_CHANGE = "qualitychange";
|
|
1239
1327
|
|
|
1240
|
-
|
|
1328
|
+
/**
|
|
1329
|
+
* @public
|
|
1330
|
+
*/
|
|
1331
|
+
declare type QualityChangeEventDetail = {
|
|
1332
|
+
before: Level | BitrateInfo;
|
|
1333
|
+
after: Level | BitrateInfo;
|
|
1334
|
+
plugin: string;
|
|
1335
|
+
automatic: boolean;
|
|
1336
|
+
downscale: boolean;
|
|
1337
|
+
};
|
|
1241
1338
|
|
|
1242
1339
|
declare enum QualityOpts {
|
|
1243
1340
|
LOW = 1,
|
|
@@ -1443,14 +1540,14 @@ declare type SourceEventDetail = SourceObj;
|
|
|
1443
1540
|
/**
|
|
1444
1541
|
* @public
|
|
1445
1542
|
*/
|
|
1446
|
-
declare type SourceObj = {
|
|
1543
|
+
declare type SourceObj<T = unknown> = {
|
|
1447
1544
|
src?: SourceStr;
|
|
1448
1545
|
/**
|
|
1449
1546
|
* the MIME type (example `video/mp4` or `application/x-mpegurl`)
|
|
1450
1547
|
*/
|
|
1451
1548
|
type?: string;
|
|
1452
1549
|
drm?: DRMSourceConfiguration;
|
|
1453
|
-
};
|
|
1550
|
+
} & T;
|
|
1454
1551
|
|
|
1455
1552
|
/**
|
|
1456
1553
|
* @public
|
|
@@ -1577,7 +1674,7 @@ declare const TV = "is-tv";
|
|
|
1577
1674
|
/**
|
|
1578
1675
|
* @public
|
|
1579
1676
|
*/
|
|
1580
|
-
declare type UnsafeSource = SourceStr | SourceObj | Array<SourceStr | SourceObj
|
|
1677
|
+
declare type UnsafeSource<SrcMixin = unknown> = SourceStr | SourceObj<SrcMixin> | Array<SourceStr | SourceObj<SrcMixin>>;
|
|
1581
1678
|
|
|
1582
1679
|
/**
|
|
1583
1680
|
* @public
|
|
@@ -1673,9 +1770,6 @@ declare const WILL_PLAY = "will-play";
|
|
|
1673
1770
|
|
|
1674
1771
|
declare const WILL_SEEK = "will-seek";
|
|
1675
1772
|
|
|
1676
|
-
declare type WithOpts<PluginPlayer extends Player = Player, PluginConfig extends Config = Config> = PluginPlayer
|
|
1677
|
-
opts: PluginConfig;
|
|
1678
|
-
setOpts(config: PluginConfig): void;
|
|
1679
|
-
};
|
|
1773
|
+
declare type WithOpts<PluginPlayer extends Player = Player, PluginConfig extends Config = Config> = SetFieldType<SetFieldType<PluginPlayer, "opts", PluginConfig>, "setOpts", (config: PluginConfig) => void>;
|
|
1680
1774
|
|
|
1681
1775
|
export { }
|
package/plugins/iframe.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
|
/**
|
|
@@ -658,19 +703,24 @@ PluginPlayer extends PlayerWith<_AttachedEventCheck>> extends Plugin_2<PluginOwn
|
|
|
658
703
|
|
|
659
704
|
declare const LOADING = "is-loading";
|
|
660
705
|
|
|
661
|
-
declare type
|
|
662
|
-
[PluginType in keyof
|
|
706
|
+
declare type MapToBareConfigs<Plugins extends PluginCtor[]> = {
|
|
707
|
+
[PluginType in keyof Plugins]: ExtractBareConfig<Plugins[PluginType]>;
|
|
663
708
|
};
|
|
664
709
|
|
|
665
|
-
declare type
|
|
666
|
-
[
|
|
710
|
+
declare type MapToPlayerExtensions<Plugins extends PluginCtor[]> = {
|
|
711
|
+
[PluginIndex in keyof Plugins]: ExtractPluginPlayerExtension<Plugins[PluginIndex]>;
|
|
667
712
|
};
|
|
668
713
|
|
|
669
714
|
declare const MENU_OPENED = "has-menu-opened";
|
|
670
715
|
|
|
671
|
-
|
|
716
|
+
/**
|
|
717
|
+
* Combines plugin config and returns a type derived from Config
|
|
718
|
+
*/
|
|
719
|
+
declare type MergeConfigs<Plugins extends PluginCtor[]> = MergePluginConfigs<MapToBareConfigs<Plugins>>;
|
|
720
|
+
|
|
721
|
+
declare type MergePlayerExtensions<Plugins extends PluginCtor[]> = ArrayToIntersection<MapToPlayerExtensions<Plugins>>;
|
|
672
722
|
|
|
673
|
-
declare type
|
|
723
|
+
declare type MergePluginConfigs<PluginBareConfigs extends unknown[]> = HasSrcExtensions<PluginBareConfigs> extends true ? ConfigWithSourceExtensions<PluginBareConfigs> : ConfigWith<ArrayToIntersection<PluginBareConfigs>>;
|
|
674
724
|
|
|
675
725
|
/**
|
|
676
726
|
* @public
|
|
@@ -765,8 +815,6 @@ declare const NO_CONTROLS = "no-controls";
|
|
|
765
815
|
|
|
766
816
|
declare const NO_DVR = "no-timeline";
|
|
767
817
|
|
|
768
|
-
declare type NoInfer_2<T> = [T][T extends any ? 0 : never];
|
|
769
|
-
|
|
770
818
|
/* Excluded from this release type: NON_RECOVERABLE_ERROR */
|
|
771
819
|
|
|
772
820
|
/* Excluded from this release type: NonRecoverableErrorEventDetail */
|
|
@@ -785,6 +833,7 @@ declare type OVPMetadata = {
|
|
|
785
833
|
category_name?: string;
|
|
786
834
|
duration?: number;
|
|
787
835
|
tags?: string;
|
|
836
|
+
playlist_title?: string;
|
|
788
837
|
};
|
|
789
838
|
|
|
790
839
|
/**
|
|
@@ -800,6 +849,26 @@ PAUSE = "pause";
|
|
|
800
849
|
|
|
801
850
|
declare const PAUSED = "is-paused";
|
|
802
851
|
|
|
852
|
+
declare type PickGlobalSrcExtension<PluginSrcs extends unknown[]> = {
|
|
853
|
+
[Index in keyof PluginSrcs]: PluginSrcs[Index] extends {
|
|
854
|
+
type: string;
|
|
855
|
+
} ? unknown : PluginSrcs[Index];
|
|
856
|
+
};
|
|
857
|
+
|
|
858
|
+
/**
|
|
859
|
+
* Maps incoming array to the src extension type
|
|
860
|
+
* @example
|
|
861
|
+
* ```
|
|
862
|
+
* PickSrcExtensions<[
|
|
863
|
+
* {configProp: boolean, src: UnsafeSource<{srcProp: boolean}>},
|
|
864
|
+
* {}
|
|
865
|
+
* ]> // = [{srcProp: boolean}, never]
|
|
866
|
+
* ```
|
|
867
|
+
*/
|
|
868
|
+
declare type PickSrcExtensions<PluginBareConfigs extends unknown[]> = {
|
|
869
|
+
[PluginType in keyof PluginBareConfigs]: ExtractSrcExtension<PluginBareConfigs[PluginType]>;
|
|
870
|
+
};
|
|
871
|
+
|
|
803
872
|
/**
|
|
804
873
|
* @public
|
|
805
874
|
*/
|
|
@@ -921,6 +990,8 @@ declare type PlayerCustomEventsDetailMap = PlayerEmittableCustomEventsDetailMap
|
|
|
921
990
|
[DVR]: DvrEventDetail;
|
|
922
991
|
[RETRY]: RetryEventDetail;
|
|
923
992
|
[RECOVER]: RecoverEventDetail;
|
|
993
|
+
[QUALITIES]: QualitiesEventDetail;
|
|
994
|
+
[QUALITY_CHANGE]: QualityChangeEventDetail;
|
|
924
995
|
/* Excluded from this release type: audioonlysource */
|
|
925
996
|
/* Excluded from this release type: renderplugin */
|
|
926
997
|
/* Excluded from this release type: "seek:queued" */
|
|
@@ -977,7 +1048,10 @@ declare type PlayerCustomEventsOverloads = {
|
|
|
977
1048
|
* Emitted when the set of underlying qualities has changed.
|
|
978
1049
|
*/
|
|
979
1050
|
on(event: typeof QUALITIES, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof QUALITIES]>) => void): Player;
|
|
980
|
-
|
|
1051
|
+
/**
|
|
1052
|
+
* Emitted when the media changes quality.
|
|
1053
|
+
*/
|
|
1054
|
+
on(event: typeof QUALITY_CHANGE, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof QUALITY_CHANGE]>) => void): Player;
|
|
981
1055
|
/* Excluded from this release type: on */
|
|
982
1056
|
/**
|
|
983
1057
|
* Listen to this event to create a recommendations grid using the data passed with the event.
|
|
@@ -1032,7 +1106,6 @@ declare type PlayerCustomEventsOverloads = {
|
|
|
1032
1106
|
/* Excluded from this release type: emit */
|
|
1033
1107
|
/* Excluded from this release type: emit */
|
|
1034
1108
|
/* Excluded from this release type: emit */
|
|
1035
|
-
/* Excluded from this release type: emit */
|
|
1036
1109
|
};
|
|
1037
1110
|
|
|
1038
1111
|
declare type PlayerEmittableCustomEventsDetailMap = {
|
|
@@ -1040,7 +1113,6 @@ declare type PlayerEmittableCustomEventsDetailMap = {
|
|
|
1040
1113
|
[CONTEXT_MENU]: ContextMenuEventDetail;
|
|
1041
1114
|
[VIEW_ENTER]: ViewEnterEventDetail;
|
|
1042
1115
|
[VIEW_LEAVE]: ViewLeaveEventDetail;
|
|
1043
|
-
[QUALITIES]: QualitiesEventDetail;
|
|
1044
1116
|
[RECOMMENDATIONS_READY]: RecommendationsReadyEventDetail;
|
|
1045
1117
|
};
|
|
1046
1118
|
|
|
@@ -1142,11 +1214,16 @@ PROGRESS = "progress";
|
|
|
1142
1214
|
/**
|
|
1143
1215
|
* @public
|
|
1144
1216
|
*/
|
|
1145
|
-
declare type QselOption = {
|
|
1146
|
-
height: number;
|
|
1217
|
+
declare type QselOption = (Level & {
|
|
1147
1218
|
level: number;
|
|
1148
|
-
|
|
1149
|
-
|
|
1219
|
+
}) | BitrateInfo | {
|
|
1220
|
+
name: string | number;
|
|
1221
|
+
encodingId: string;
|
|
1222
|
+
spatialLayerId: number;
|
|
1223
|
+
temporalLayerId: number;
|
|
1224
|
+
maxSpatialLayerId: number;
|
|
1225
|
+
maxTemporalLayerId: number;
|
|
1226
|
+
height: number;
|
|
1150
1227
|
width: number;
|
|
1151
1228
|
};
|
|
1152
1229
|
|
|
@@ -1170,9 +1247,29 @@ QUALITIES = "qualities";
|
|
|
1170
1247
|
*/
|
|
1171
1248
|
declare type QualitiesEventDetail = QselOption[];
|
|
1172
1249
|
|
|
1173
|
-
|
|
1250
|
+
/**
|
|
1251
|
+
* @public
|
|
1252
|
+
* emitted whenever the media changes quality
|
|
1253
|
+
*/
|
|
1254
|
+
declare const /**
|
|
1255
|
+
@public
|
|
1256
|
+
* when a new player is inserted into the HTML
|
|
1257
|
+
*/ /**
|
|
1258
|
+
* @public
|
|
1259
|
+
* emitted whenever the media changes quality
|
|
1260
|
+
*/
|
|
1261
|
+
QUALITY_CHANGE = "qualitychange";
|
|
1174
1262
|
|
|
1175
|
-
|
|
1263
|
+
/**
|
|
1264
|
+
* @public
|
|
1265
|
+
*/
|
|
1266
|
+
declare type QualityChangeEventDetail = {
|
|
1267
|
+
before: Level | BitrateInfo;
|
|
1268
|
+
after: Level | BitrateInfo;
|
|
1269
|
+
plugin: string;
|
|
1270
|
+
automatic: boolean;
|
|
1271
|
+
downscale: boolean;
|
|
1272
|
+
};
|
|
1176
1273
|
|
|
1177
1274
|
declare enum QualityOpts {
|
|
1178
1275
|
LOW = 1,
|
|
@@ -1378,14 +1475,14 @@ declare type SourceEventDetail = SourceObj;
|
|
|
1378
1475
|
/**
|
|
1379
1476
|
* @public
|
|
1380
1477
|
*/
|
|
1381
|
-
declare type SourceObj = {
|
|
1478
|
+
declare type SourceObj<T = unknown> = {
|
|
1382
1479
|
src?: SourceStr;
|
|
1383
1480
|
/**
|
|
1384
1481
|
* the MIME type (example `video/mp4` or `application/x-mpegurl`)
|
|
1385
1482
|
*/
|
|
1386
1483
|
type?: string;
|
|
1387
1484
|
drm?: DRMSourceConfiguration;
|
|
1388
|
-
};
|
|
1485
|
+
} & T;
|
|
1389
1486
|
|
|
1390
1487
|
/**
|
|
1391
1488
|
* @public
|
|
@@ -1512,7 +1609,7 @@ declare const TV = "is-tv";
|
|
|
1512
1609
|
/**
|
|
1513
1610
|
* @public
|
|
1514
1611
|
*/
|
|
1515
|
-
declare type UnsafeSource = SourceStr | SourceObj | Array<SourceStr | SourceObj
|
|
1612
|
+
declare type UnsafeSource<SrcMixin = unknown> = SourceStr | SourceObj<SrcMixin> | Array<SourceStr | SourceObj<SrcMixin>>;
|
|
1516
1613
|
|
|
1517
1614
|
/**
|
|
1518
1615
|
* @public
|
|
@@ -1608,9 +1705,6 @@ declare const WILL_PLAY = "will-play";
|
|
|
1608
1705
|
|
|
1609
1706
|
declare const WILL_SEEK = "will-seek";
|
|
1610
1707
|
|
|
1611
|
-
declare type WithOpts<PluginPlayer extends Player = Player, PluginConfig extends Config = Config> = PluginPlayer
|
|
1612
|
-
opts: PluginConfig;
|
|
1613
|
-
setOpts(config: PluginConfig): void;
|
|
1614
|
-
};
|
|
1708
|
+
declare type WithOpts<PluginPlayer extends Player = Player, PluginConfig extends Config = Config> = SetFieldType<SetFieldType<PluginPlayer, "opts", PluginConfig>, "setOpts", (config: PluginConfig) => void>;
|
|
1615
1709
|
|
|
1616
1710
|
export { }
|