@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/subtitles.d.ts
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
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 { LevelAttributes } from 'hls.js';
|
|
5
7
|
import type { MediaKeyFunc } from 'hls.js';
|
|
8
|
+
import type { SetFieldType } from 'type-fest';
|
|
9
|
+
import type { TupleToUnion } from 'type-fest';
|
|
6
10
|
|
|
7
11
|
/* Excluded from this release type: AnyLoader */
|
|
8
12
|
|
|
@@ -80,6 +84,26 @@ declare const /**
|
|
|
80
84
|
*/
|
|
81
85
|
CLICK = "click";
|
|
82
86
|
|
|
87
|
+
/**
|
|
88
|
+
* For plugins that add new properties to all source types, combine their src-mixins into one SourceObject
|
|
89
|
+
* @example
|
|
90
|
+
* ```
|
|
91
|
+
* type Combined = CombineGlobalSrcExtensions<DRMPlugin, PluginWithFooFieldInSrc> // Combined = SourceObject<DRMConfig & FooFieldConfig>
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
94
|
+
declare type CombineGlobalSrcExtensions<PluginSrcs extends unknown[]> = HasGlobalSrcExtensios<PluginSrcs> extends false ? SourceObj : SourceObj & ArrayToIntersection<PickGlobalSrcExtension<PluginSrcs>>;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* For plugins that define a new src type, make a union of all new src.type declarations
|
|
98
|
+
* @example
|
|
99
|
+
* ```
|
|
100
|
+
* type Combined = CombineNewSourceTypes<RTSPlugin, SSAIPlugin> // Combined = DRMConfig | FooFieldConfig
|
|
101
|
+
* ```
|
|
102
|
+
*/
|
|
103
|
+
declare type CombineNewSourceTypes<PluginSrcs extends unknown[]> = TupleToUnion<FilterNewSourceTypes<PluginSrcs>>;
|
|
104
|
+
|
|
105
|
+
declare type CombineSrc<PluginSrcs extends unknown[]> = UnsafeSource<CombineGlobalSrcExtensions<PluginSrcs> | (CombineNewSourceTypes<PluginSrcs> & CombineGlobalSrcExtensions<PluginSrcs>)>;
|
|
106
|
+
|
|
83
107
|
/* Excluded from this release type: Component */
|
|
84
108
|
|
|
85
109
|
/* Excluded from this release type: Components */
|
|
@@ -140,6 +164,10 @@ declare interface Config {
|
|
|
140
164
|
*/
|
|
141
165
|
declare type ConfigWith<T> = Config & T;
|
|
142
166
|
|
|
167
|
+
declare type ConfigWithSourceExtensions<PluginBareConfigs extends unknown[]> = Omit<ConfigWith<ArrayToIntersection<PluginBareConfigs>>, "src"> & {
|
|
168
|
+
src?: CombineSrc<PickSrcExtensions<PluginBareConfigs>>;
|
|
169
|
+
};
|
|
170
|
+
|
|
143
171
|
/* Excluded from this release type: CONTENT_REAL_LOAD_START */
|
|
144
172
|
|
|
145
173
|
/**
|
|
@@ -385,6 +413,7 @@ declare namespace events {
|
|
|
385
413
|
SOURCE,
|
|
386
414
|
REAP,
|
|
387
415
|
QUALITIES,
|
|
416
|
+
QUALITY_CHANGE,
|
|
388
417
|
VIDEO_TRACKS,
|
|
389
418
|
SET_QUALITY,
|
|
390
419
|
VIDEO_TRACK_SELECT,
|
|
@@ -408,8 +437,20 @@ declare namespace events_2 {
|
|
|
408
437
|
}
|
|
409
438
|
}
|
|
410
439
|
|
|
440
|
+
declare type ExtractBareConfig<Plugins extends PluginCtor> = Plugins extends PluginCtor<ConfigWith<infer ConfigType>> ? ConfigType : never;
|
|
441
|
+
|
|
442
|
+
declare type ExtractPluginPlayerExtension<Plugin extends PluginCtor> = Plugin extends PluginCtor<infer _uConfigType, PlayerWith<infer PluginPlayer>> ? PluginPlayer : never;
|
|
443
|
+
|
|
411
444
|
declare type ExtractPureAPI<T> = T extends PlayerWith<infer PureAPI> ? PureAPI : never;
|
|
412
445
|
|
|
446
|
+
declare type ExtractSrcExtension<PluginBareConfig> = Get<PluginBareConfig, "src"> extends UnsafeSource<infer SrcMixinType> ? SrcMixinType : never;
|
|
447
|
+
|
|
448
|
+
declare type FilterNewSourceTypes<PluginSrcs extends unknown[]> = {
|
|
449
|
+
[Index in keyof PluginSrcs]: PluginSrcs[Index] extends {
|
|
450
|
+
type: string;
|
|
451
|
+
} ? PluginSrcs[Index] : never;
|
|
452
|
+
};
|
|
453
|
+
|
|
413
454
|
/**
|
|
414
455
|
* @public
|
|
415
456
|
*/
|
|
@@ -452,7 +493,7 @@ declare interface FlowplayerUMD extends FlowplayerUMDBase {
|
|
|
452
493
|
* Register plugins in flowplayer
|
|
453
494
|
* @returns flowplayer instance with registered plugins
|
|
454
495
|
*/
|
|
455
|
-
<PluginCtors extends PluginCtor[]>(...plugins: PluginCtors): FlowplayerUMDWithPlugins<
|
|
496
|
+
<PluginCtors extends PluginCtor[]>(...plugins: PluginCtors): FlowplayerUMDWithPlugins<MergeConfigs<PluginCtors>, PlayerWith<MergePlayerExtensions<PluginCtors>>>;
|
|
456
497
|
}
|
|
457
498
|
|
|
458
499
|
declare interface FlowplayerUMDBase {
|
|
@@ -553,6 +594,10 @@ declare const GRABBING = "is-grabbing";
|
|
|
553
594
|
|
|
554
595
|
declare const HAS_POSTER = "has-poster";
|
|
555
596
|
|
|
597
|
+
declare type HasGlobalSrcExtensios<PluginSrcs extends unknown[]> = ArrayToIntersection<PickGlobalSrcExtension<PluginSrcs>>;
|
|
598
|
+
|
|
599
|
+
declare type HasSrcExtensions<PluginBareConfigs extends unknown[]> = TupleToUnion<PickSrcExtensions<PluginBareConfigs>> extends never ? false : true;
|
|
600
|
+
|
|
556
601
|
declare const HOVERED = "is-hovered";
|
|
557
602
|
|
|
558
603
|
/**
|
|
@@ -709,19 +754,24 @@ PluginPlayer extends PlayerWith<_AttachedEventCheck>> extends Plugin_2<PluginOwn
|
|
|
709
754
|
|
|
710
755
|
declare const LOADING = "is-loading";
|
|
711
756
|
|
|
712
|
-
declare type
|
|
713
|
-
[PluginType in keyof
|
|
757
|
+
declare type MapToBareConfigs<Plugins extends PluginCtor[]> = {
|
|
758
|
+
[PluginType in keyof Plugins]: ExtractBareConfig<Plugins[PluginType]>;
|
|
714
759
|
};
|
|
715
760
|
|
|
716
|
-
declare type
|
|
717
|
-
[
|
|
761
|
+
declare type MapToPlayerExtensions<Plugins extends PluginCtor[]> = {
|
|
762
|
+
[PluginIndex in keyof Plugins]: ExtractPluginPlayerExtension<Plugins[PluginIndex]>;
|
|
718
763
|
};
|
|
719
764
|
|
|
720
765
|
declare const MENU_OPENED = "has-menu-opened";
|
|
721
766
|
|
|
722
|
-
|
|
767
|
+
/**
|
|
768
|
+
* Combines plugin config and returns a type derived from Config
|
|
769
|
+
*/
|
|
770
|
+
declare type MergeConfigs<Plugins extends PluginCtor[]> = MergePluginConfigs<MapToBareConfigs<Plugins>>;
|
|
771
|
+
|
|
772
|
+
declare type MergePlayerExtensions<Plugins extends PluginCtor[]> = ArrayToIntersection<MapToPlayerExtensions<Plugins>>;
|
|
723
773
|
|
|
724
|
-
declare type
|
|
774
|
+
declare type MergePluginConfigs<PluginBareConfigs extends unknown[]> = HasSrcExtensions<PluginBareConfigs> extends true ? ConfigWithSourceExtensions<PluginBareConfigs> : ConfigWith<ArrayToIntersection<PluginBareConfigs>>;
|
|
725
775
|
|
|
726
776
|
/**
|
|
727
777
|
* @public
|
|
@@ -816,8 +866,6 @@ declare const NO_CONTROLS = "no-controls";
|
|
|
816
866
|
|
|
817
867
|
declare const NO_DVR = "no-timeline";
|
|
818
868
|
|
|
819
|
-
declare type NoInfer_2<T> = [T][T extends any ? 0 : never];
|
|
820
|
-
|
|
821
869
|
/* Excluded from this release type: NON_RECOVERABLE_ERROR */
|
|
822
870
|
|
|
823
871
|
/* Excluded from this release type: NonRecoverableErrorEventDetail */
|
|
@@ -836,6 +884,7 @@ declare type OVPMetadata = {
|
|
|
836
884
|
category_name?: string;
|
|
837
885
|
duration?: number;
|
|
838
886
|
tags?: string;
|
|
887
|
+
playlist_title?: string;
|
|
839
888
|
};
|
|
840
889
|
|
|
841
890
|
/**
|
|
@@ -851,6 +900,26 @@ PAUSE = "pause";
|
|
|
851
900
|
|
|
852
901
|
declare const PAUSED = "is-paused";
|
|
853
902
|
|
|
903
|
+
declare type PickGlobalSrcExtension<PluginSrcs extends unknown[]> = {
|
|
904
|
+
[Index in keyof PluginSrcs]: PluginSrcs[Index] extends {
|
|
905
|
+
type: string;
|
|
906
|
+
} ? unknown : PluginSrcs[Index];
|
|
907
|
+
};
|
|
908
|
+
|
|
909
|
+
/**
|
|
910
|
+
* Maps incoming array to the src extension type
|
|
911
|
+
* @example
|
|
912
|
+
* ```
|
|
913
|
+
* PickSrcExtensions<[
|
|
914
|
+
* {configProp: boolean, src: UnsafeSource<{srcProp: boolean}>},
|
|
915
|
+
* {}
|
|
916
|
+
* ]> // = [{srcProp: boolean}, never]
|
|
917
|
+
* ```
|
|
918
|
+
*/
|
|
919
|
+
declare type PickSrcExtensions<PluginBareConfigs extends unknown[]> = {
|
|
920
|
+
[PluginType in keyof PluginBareConfigs]: ExtractSrcExtension<PluginBareConfigs[PluginType]>;
|
|
921
|
+
};
|
|
922
|
+
|
|
854
923
|
/**
|
|
855
924
|
* @public
|
|
856
925
|
*/
|
|
@@ -972,6 +1041,8 @@ declare type PlayerCustomEventsDetailMap = PlayerEmittableCustomEventsDetailMap
|
|
|
972
1041
|
[DVR]: DvrEventDetail;
|
|
973
1042
|
[RETRY]: RetryEventDetail;
|
|
974
1043
|
[RECOVER]: RecoverEventDetail;
|
|
1044
|
+
[QUALITIES]: QualitiesEventDetail;
|
|
1045
|
+
[QUALITY_CHANGE]: QualityChangeEventDetail;
|
|
975
1046
|
/* Excluded from this release type: audioonlysource */
|
|
976
1047
|
/* Excluded from this release type: renderplugin */
|
|
977
1048
|
/* Excluded from this release type: "seek:queued" */
|
|
@@ -1028,7 +1099,10 @@ declare type PlayerCustomEventsOverloads = {
|
|
|
1028
1099
|
* Emitted when the set of underlying qualities has changed.
|
|
1029
1100
|
*/
|
|
1030
1101
|
on(event: typeof QUALITIES, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof QUALITIES]>) => void): Player;
|
|
1031
|
-
|
|
1102
|
+
/**
|
|
1103
|
+
* Emitted when the media changes quality.
|
|
1104
|
+
*/
|
|
1105
|
+
on(event: typeof QUALITY_CHANGE, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof QUALITY_CHANGE]>) => void): Player;
|
|
1032
1106
|
/* Excluded from this release type: on */
|
|
1033
1107
|
/**
|
|
1034
1108
|
* Listen to this event to create a recommendations grid using the data passed with the event.
|
|
@@ -1083,7 +1157,6 @@ declare type PlayerCustomEventsOverloads = {
|
|
|
1083
1157
|
/* Excluded from this release type: emit */
|
|
1084
1158
|
/* Excluded from this release type: emit */
|
|
1085
1159
|
/* Excluded from this release type: emit */
|
|
1086
|
-
/* Excluded from this release type: emit */
|
|
1087
1160
|
};
|
|
1088
1161
|
|
|
1089
1162
|
declare type PlayerEmittableCustomEventsDetailMap = {
|
|
@@ -1091,7 +1164,6 @@ declare type PlayerEmittableCustomEventsDetailMap = {
|
|
|
1091
1164
|
[CONTEXT_MENU]: ContextMenuEventDetail;
|
|
1092
1165
|
[VIEW_ENTER]: ViewEnterEventDetail;
|
|
1093
1166
|
[VIEW_LEAVE]: ViewLeaveEventDetail;
|
|
1094
|
-
[QUALITIES]: QualitiesEventDetail;
|
|
1095
1167
|
[RECOMMENDATIONS_READY]: RecommendationsReadyEventDetail;
|
|
1096
1168
|
};
|
|
1097
1169
|
|
|
@@ -1193,11 +1265,16 @@ PROGRESS = "progress";
|
|
|
1193
1265
|
/**
|
|
1194
1266
|
* @public
|
|
1195
1267
|
*/
|
|
1196
|
-
declare type QselOption = {
|
|
1197
|
-
height: number;
|
|
1268
|
+
declare type QselOption = (Level & {
|
|
1198
1269
|
level: number;
|
|
1199
|
-
|
|
1200
|
-
|
|
1270
|
+
}) | BitrateInfo | {
|
|
1271
|
+
name: string | number;
|
|
1272
|
+
encodingId: string;
|
|
1273
|
+
spatialLayerId: number;
|
|
1274
|
+
temporalLayerId: number;
|
|
1275
|
+
maxSpatialLayerId: number;
|
|
1276
|
+
maxTemporalLayerId: number;
|
|
1277
|
+
height: number;
|
|
1201
1278
|
width: number;
|
|
1202
1279
|
};
|
|
1203
1280
|
|
|
@@ -1221,9 +1298,29 @@ QUALITIES = "qualities";
|
|
|
1221
1298
|
*/
|
|
1222
1299
|
declare type QualitiesEventDetail = QselOption[];
|
|
1223
1300
|
|
|
1224
|
-
|
|
1301
|
+
/**
|
|
1302
|
+
* @public
|
|
1303
|
+
* emitted whenever the media changes quality
|
|
1304
|
+
*/
|
|
1305
|
+
declare const /**
|
|
1306
|
+
@public
|
|
1307
|
+
* when a new player is inserted into the HTML
|
|
1308
|
+
*/ /**
|
|
1309
|
+
* @public
|
|
1310
|
+
* emitted whenever the media changes quality
|
|
1311
|
+
*/
|
|
1312
|
+
QUALITY_CHANGE = "qualitychange";
|
|
1225
1313
|
|
|
1226
|
-
|
|
1314
|
+
/**
|
|
1315
|
+
* @public
|
|
1316
|
+
*/
|
|
1317
|
+
declare type QualityChangeEventDetail = {
|
|
1318
|
+
before: Level | BitrateInfo;
|
|
1319
|
+
after: Level | BitrateInfo;
|
|
1320
|
+
plugin: string;
|
|
1321
|
+
automatic: boolean;
|
|
1322
|
+
downscale: boolean;
|
|
1323
|
+
};
|
|
1227
1324
|
|
|
1228
1325
|
declare enum QualityOpts {
|
|
1229
1326
|
LOW = 1,
|
|
@@ -1429,14 +1526,14 @@ declare type SourceEventDetail = SourceObj;
|
|
|
1429
1526
|
/**
|
|
1430
1527
|
* @public
|
|
1431
1528
|
*/
|
|
1432
|
-
declare type SourceObj = {
|
|
1529
|
+
declare type SourceObj<T = unknown> = {
|
|
1433
1530
|
src?: SourceStr;
|
|
1434
1531
|
/**
|
|
1435
1532
|
* the MIME type (example `video/mp4` or `application/x-mpegurl`)
|
|
1436
1533
|
*/
|
|
1437
1534
|
type?: string;
|
|
1438
1535
|
drm?: DRMSourceConfiguration;
|
|
1439
|
-
};
|
|
1536
|
+
} & T;
|
|
1440
1537
|
|
|
1441
1538
|
/**
|
|
1442
1539
|
* @public
|
|
@@ -1499,7 +1596,7 @@ declare namespace states {
|
|
|
1499
1596
|
* @public
|
|
1500
1597
|
* html subtitles plugin
|
|
1501
1598
|
**/
|
|
1502
|
-
declare const Subtitles: PluginCtor<SubtitlesConfig
|
|
1599
|
+
declare const Subtitles: PluginCtor<NoInfer<SubtitlesConfig>, NoInfer<SubtitlesPlayer>> & NoInfer<SubtitlesAPI>;
|
|
1503
1600
|
export default Subtitles;
|
|
1504
1601
|
|
|
1505
1602
|
/**
|
|
@@ -1678,7 +1775,7 @@ declare const TV = "is-tv";
|
|
|
1678
1775
|
/**
|
|
1679
1776
|
* @public
|
|
1680
1777
|
*/
|
|
1681
|
-
declare type UnsafeSource = SourceStr | SourceObj | Array<SourceStr | SourceObj
|
|
1778
|
+
declare type UnsafeSource<SrcMixin = unknown> = SourceStr | SourceObj<SrcMixin> | Array<SourceStr | SourceObj<SrcMixin>>;
|
|
1682
1779
|
|
|
1683
1780
|
/**
|
|
1684
1781
|
* @public
|
|
@@ -1774,9 +1871,6 @@ declare const WILL_PLAY = "will-play";
|
|
|
1774
1871
|
|
|
1775
1872
|
declare const WILL_SEEK = "will-seek";
|
|
1776
1873
|
|
|
1777
|
-
declare type WithOpts<PluginPlayer extends Player = Player, PluginConfig extends Config = Config> = PluginPlayer
|
|
1778
|
-
opts: PluginConfig;
|
|
1779
|
-
setOpts(config: PluginConfig): void;
|
|
1780
|
-
};
|
|
1874
|
+
declare type WithOpts<PluginPlayer extends Player = Player, PluginConfig extends Config = Config> = SetFieldType<SetFieldType<PluginPlayer, "opts", PluginConfig>, "setOpts", (config: PluginConfig) => void>;
|
|
1781
1875
|
|
|
1782
1876
|
export { }
|
package/plugins/thumbnails.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";
|
|
@@ -651,19 +696,24 @@ 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
|
declare const MENU_OPENED = "has-menu-opened";
|
|
663
708
|
|
|
664
|
-
|
|
709
|
+
/**
|
|
710
|
+
* Combines plugin config and returns a type derived from Config
|
|
711
|
+
*/
|
|
712
|
+
declare type MergeConfigs<Plugins extends PluginCtor[]> = MergePluginConfigs<MapToBareConfigs<Plugins>>;
|
|
665
713
|
|
|
666
|
-
declare type
|
|
714
|
+
declare type MergePlayerExtensions<Plugins extends PluginCtor[]> = ArrayToIntersection<MapToPlayerExtensions<Plugins>>;
|
|
715
|
+
|
|
716
|
+
declare type MergePluginConfigs<PluginBareConfigs extends unknown[]> = HasSrcExtensions<PluginBareConfigs> extends true ? ConfigWithSourceExtensions<PluginBareConfigs> : ConfigWith<ArrayToIntersection<PluginBareConfigs>>;
|
|
667
717
|
|
|
668
718
|
/**
|
|
669
719
|
* @public
|
|
@@ -758,8 +808,6 @@ declare const NO_CONTROLS = "no-controls";
|
|
|
758
808
|
|
|
759
809
|
declare const NO_DVR = "no-timeline";
|
|
760
810
|
|
|
761
|
-
declare type NoInfer_2<T> = [T][T extends any ? 0 : never];
|
|
762
|
-
|
|
763
811
|
/* Excluded from this release type: NON_RECOVERABLE_ERROR */
|
|
764
812
|
|
|
765
813
|
/* Excluded from this release type: NonRecoverableErrorEventDetail */
|
|
@@ -778,6 +826,7 @@ declare type OVPMetadata = {
|
|
|
778
826
|
category_name?: string;
|
|
779
827
|
duration?: number;
|
|
780
828
|
tags?: string;
|
|
829
|
+
playlist_title?: string;
|
|
781
830
|
};
|
|
782
831
|
|
|
783
832
|
/**
|
|
@@ -793,6 +842,26 @@ PAUSE = "pause";
|
|
|
793
842
|
|
|
794
843
|
declare const PAUSED = "is-paused";
|
|
795
844
|
|
|
845
|
+
declare type PickGlobalSrcExtension<PluginSrcs extends unknown[]> = {
|
|
846
|
+
[Index in keyof PluginSrcs]: PluginSrcs[Index] extends {
|
|
847
|
+
type: string;
|
|
848
|
+
} ? unknown : PluginSrcs[Index];
|
|
849
|
+
};
|
|
850
|
+
|
|
851
|
+
/**
|
|
852
|
+
* Maps incoming array to the src extension type
|
|
853
|
+
* @example
|
|
854
|
+
* ```
|
|
855
|
+
* PickSrcExtensions<[
|
|
856
|
+
* {configProp: boolean, src: UnsafeSource<{srcProp: boolean}>},
|
|
857
|
+
* {}
|
|
858
|
+
* ]> // = [{srcProp: boolean}, never]
|
|
859
|
+
* ```
|
|
860
|
+
*/
|
|
861
|
+
declare type PickSrcExtensions<PluginBareConfigs extends unknown[]> = {
|
|
862
|
+
[PluginType in keyof PluginBareConfigs]: ExtractSrcExtension<PluginBareConfigs[PluginType]>;
|
|
863
|
+
};
|
|
864
|
+
|
|
796
865
|
/**
|
|
797
866
|
* @public
|
|
798
867
|
*/
|
|
@@ -914,6 +983,8 @@ declare type PlayerCustomEventsDetailMap = PlayerEmittableCustomEventsDetailMap
|
|
|
914
983
|
[DVR]: DvrEventDetail;
|
|
915
984
|
[RETRY]: RetryEventDetail;
|
|
916
985
|
[RECOVER]: RecoverEventDetail;
|
|
986
|
+
[QUALITIES]: QualitiesEventDetail;
|
|
987
|
+
[QUALITY_CHANGE]: QualityChangeEventDetail;
|
|
917
988
|
/* Excluded from this release type: audioonlysource */
|
|
918
989
|
/* Excluded from this release type: renderplugin */
|
|
919
990
|
/* Excluded from this release type: "seek:queued" */
|
|
@@ -970,7 +1041,10 @@ declare type PlayerCustomEventsOverloads = {
|
|
|
970
1041
|
* Emitted when the set of underlying qualities has changed.
|
|
971
1042
|
*/
|
|
972
1043
|
on(event: typeof QUALITIES, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof QUALITIES]>) => void): Player;
|
|
973
|
-
|
|
1044
|
+
/**
|
|
1045
|
+
* Emitted when the media changes quality.
|
|
1046
|
+
*/
|
|
1047
|
+
on(event: typeof QUALITY_CHANGE, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof QUALITY_CHANGE]>) => void): Player;
|
|
974
1048
|
/* Excluded from this release type: on */
|
|
975
1049
|
/**
|
|
976
1050
|
* Listen to this event to create a recommendations grid using the data passed with the event.
|
|
@@ -1025,7 +1099,6 @@ declare type PlayerCustomEventsOverloads = {
|
|
|
1025
1099
|
/* Excluded from this release type: emit */
|
|
1026
1100
|
/* Excluded from this release type: emit */
|
|
1027
1101
|
/* Excluded from this release type: emit */
|
|
1028
|
-
/* Excluded from this release type: emit */
|
|
1029
1102
|
};
|
|
1030
1103
|
|
|
1031
1104
|
declare type PlayerEmittableCustomEventsDetailMap = {
|
|
@@ -1033,7 +1106,6 @@ declare type PlayerEmittableCustomEventsDetailMap = {
|
|
|
1033
1106
|
[CONTEXT_MENU]: ContextMenuEventDetail;
|
|
1034
1107
|
[VIEW_ENTER]: ViewEnterEventDetail;
|
|
1035
1108
|
[VIEW_LEAVE]: ViewLeaveEventDetail;
|
|
1036
|
-
[QUALITIES]: QualitiesEventDetail;
|
|
1037
1109
|
[RECOMMENDATIONS_READY]: RecommendationsReadyEventDetail;
|
|
1038
1110
|
};
|
|
1039
1111
|
|
|
@@ -1135,11 +1207,16 @@ PROGRESS = "progress";
|
|
|
1135
1207
|
/**
|
|
1136
1208
|
* @public
|
|
1137
1209
|
*/
|
|
1138
|
-
declare type QselOption = {
|
|
1139
|
-
height: number;
|
|
1210
|
+
declare type QselOption = (Level & {
|
|
1140
1211
|
level: number;
|
|
1141
|
-
|
|
1142
|
-
|
|
1212
|
+
}) | BitrateInfo | {
|
|
1213
|
+
name: string | number;
|
|
1214
|
+
encodingId: string;
|
|
1215
|
+
spatialLayerId: number;
|
|
1216
|
+
temporalLayerId: number;
|
|
1217
|
+
maxSpatialLayerId: number;
|
|
1218
|
+
maxTemporalLayerId: number;
|
|
1219
|
+
height: number;
|
|
1143
1220
|
width: number;
|
|
1144
1221
|
};
|
|
1145
1222
|
|
|
@@ -1163,9 +1240,29 @@ QUALITIES = "qualities";
|
|
|
1163
1240
|
*/
|
|
1164
1241
|
declare type QualitiesEventDetail = QselOption[];
|
|
1165
1242
|
|
|
1166
|
-
|
|
1243
|
+
/**
|
|
1244
|
+
* @public
|
|
1245
|
+
* emitted whenever the media changes quality
|
|
1246
|
+
*/
|
|
1247
|
+
declare const /**
|
|
1248
|
+
@public
|
|
1249
|
+
* when a new player is inserted into the HTML
|
|
1250
|
+
*/ /**
|
|
1251
|
+
* @public
|
|
1252
|
+
* emitted whenever the media changes quality
|
|
1253
|
+
*/
|
|
1254
|
+
QUALITY_CHANGE = "qualitychange";
|
|
1167
1255
|
|
|
1168
|
-
|
|
1256
|
+
/**
|
|
1257
|
+
* @public
|
|
1258
|
+
*/
|
|
1259
|
+
declare type QualityChangeEventDetail = {
|
|
1260
|
+
before: Level | BitrateInfo;
|
|
1261
|
+
after: Level | BitrateInfo;
|
|
1262
|
+
plugin: string;
|
|
1263
|
+
automatic: boolean;
|
|
1264
|
+
downscale: boolean;
|
|
1265
|
+
};
|
|
1169
1266
|
|
|
1170
1267
|
declare enum QualityOpts {
|
|
1171
1268
|
LOW = 1,
|
|
@@ -1371,14 +1468,14 @@ declare type SourceEventDetail = SourceObj;
|
|
|
1371
1468
|
/**
|
|
1372
1469
|
* @public
|
|
1373
1470
|
*/
|
|
1374
|
-
declare type SourceObj = {
|
|
1471
|
+
declare type SourceObj<T = unknown> = {
|
|
1375
1472
|
src?: SourceStr;
|
|
1376
1473
|
/**
|
|
1377
1474
|
* the MIME type (example `video/mp4` or `application/x-mpegurl`)
|
|
1378
1475
|
*/
|
|
1379
1476
|
type?: string;
|
|
1380
1477
|
drm?: DRMSourceConfiguration;
|
|
1381
|
-
};
|
|
1478
|
+
} & T;
|
|
1382
1479
|
|
|
1383
1480
|
/**
|
|
1384
1481
|
* @public
|
|
@@ -1439,16 +1536,27 @@ declare namespace states {
|
|
|
1439
1536
|
|
|
1440
1537
|
/**
|
|
1441
1538
|
* @public
|
|
1539
|
+
* This plugin adds support for vtt-based thumbnail sprites in the timeline tooltip.
|
|
1540
|
+
* See {@link https://developer.wowza.com/docs/wowza-flowplayer/plugins/preview-thumbnails/ |Official Documentation}
|
|
1442
1541
|
*/
|
|
1443
|
-
declare const Thumbnails: PluginCtor<
|
|
1542
|
+
declare const Thumbnails: PluginCtor<NoInfer<ThumbnailsConfig>, NoInfer<Player>>;
|
|
1444
1543
|
export default Thumbnails;
|
|
1445
1544
|
|
|
1446
1545
|
/**
|
|
1447
|
-
*
|
|
1546
|
+
* @public
|
|
1448
1547
|
*/
|
|
1449
|
-
export declare type ThumbnailsConfig = {
|
|
1450
|
-
|
|
1451
|
-
|
|
1548
|
+
export declare type ThumbnailsConfig = ConfigWith<{
|
|
1549
|
+
/**
|
|
1550
|
+
* Configuration for Thumbnails plugin
|
|
1551
|
+
*/
|
|
1552
|
+
thumbnails?: {
|
|
1553
|
+
/**
|
|
1554
|
+
* The location to fetch the VTT formatted thumbnails from.
|
|
1555
|
+
* The VTT files must be configured in the form of sprite-based thumbnails
|
|
1556
|
+
*/
|
|
1557
|
+
src: string;
|
|
1558
|
+
};
|
|
1559
|
+
}>;
|
|
1452
1560
|
|
|
1453
1561
|
/**
|
|
1454
1562
|
* @public
|
|
@@ -1518,7 +1626,7 @@ declare const TV = "is-tv";
|
|
|
1518
1626
|
/**
|
|
1519
1627
|
* @public
|
|
1520
1628
|
*/
|
|
1521
|
-
declare type UnsafeSource = SourceStr | SourceObj | Array<SourceStr | SourceObj
|
|
1629
|
+
declare type UnsafeSource<SrcMixin = unknown> = SourceStr | SourceObj<SrcMixin> | Array<SourceStr | SourceObj<SrcMixin>>;
|
|
1522
1630
|
|
|
1523
1631
|
/**
|
|
1524
1632
|
* @public
|
|
@@ -1614,9 +1722,6 @@ declare const WILL_PLAY = "will-play";
|
|
|
1614
1722
|
|
|
1615
1723
|
declare const WILL_SEEK = "will-seek";
|
|
1616
1724
|
|
|
1617
|
-
declare type WithOpts<PluginPlayer extends Player = Player, PluginConfig extends Config = Config> = PluginPlayer
|
|
1618
|
-
opts: PluginConfig;
|
|
1619
|
-
setOpts(config: PluginConfig): void;
|
|
1620
|
-
};
|
|
1725
|
+
declare type WithOpts<PluginPlayer extends Player = Player, PluginConfig extends Config = Config> = SetFieldType<SetFieldType<PluginPlayer, "opts", PluginConfig>, "setOpts", (config: PluginConfig) => void>;
|
|
1621
1726
|
|
|
1622
1727
|
export { }
|