@flowplayer/player 3.19.0 → 3.20.0-rc.5
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/message.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
|
/**
|
|
@@ -384,6 +412,7 @@ declare namespace events {
|
|
|
384
412
|
SOURCE,
|
|
385
413
|
REAP,
|
|
386
414
|
QUALITIES,
|
|
415
|
+
QUALITY_CHANGE,
|
|
387
416
|
VIDEO_TRACKS,
|
|
388
417
|
SET_QUALITY,
|
|
389
418
|
VIDEO_TRACK_SELECT,
|
|
@@ -405,8 +434,20 @@ declare namespace events_2 {
|
|
|
405
434
|
}
|
|
406
435
|
}
|
|
407
436
|
|
|
437
|
+
declare type ExtractBareConfig<Plugins extends PluginCtor> = Plugins extends PluginCtor<ConfigWith<infer ConfigType>> ? ConfigType : never;
|
|
438
|
+
|
|
439
|
+
declare type ExtractPluginPlayerExtension<Plugin extends PluginCtor> = Plugin extends PluginCtor<infer _uConfigType, PlayerWith<infer PluginPlayer>> ? PluginPlayer : never;
|
|
440
|
+
|
|
408
441
|
declare type ExtractPureAPI<T> = T extends PlayerWith<infer PureAPI> ? PureAPI : never;
|
|
409
442
|
|
|
443
|
+
declare type ExtractSrcExtension<PluginBareConfig> = Get<PluginBareConfig, "src"> extends UnsafeSource<infer SrcMixinType> ? SrcMixinType : never;
|
|
444
|
+
|
|
445
|
+
declare type FilterNewSourceTypes<PluginSrcs extends unknown[]> = {
|
|
446
|
+
[Index in keyof PluginSrcs]: PluginSrcs[Index] extends {
|
|
447
|
+
type: string;
|
|
448
|
+
} ? PluginSrcs[Index] : never;
|
|
449
|
+
};
|
|
450
|
+
|
|
410
451
|
/**
|
|
411
452
|
* @public
|
|
412
453
|
*/
|
|
@@ -449,7 +490,7 @@ declare interface FlowplayerUMD extends FlowplayerUMDBase {
|
|
|
449
490
|
* Register plugins in flowplayer
|
|
450
491
|
* @returns flowplayer instance with registered plugins
|
|
451
492
|
*/
|
|
452
|
-
<PluginCtors extends PluginCtor[]>(...plugins: PluginCtors): FlowplayerUMDWithPlugins<
|
|
493
|
+
<PluginCtors extends PluginCtor[]>(...plugins: PluginCtors): FlowplayerUMDWithPlugins<MergeConfigs<PluginCtors>, PlayerWith<MergePlayerExtensions<PluginCtors>>>;
|
|
453
494
|
}
|
|
454
495
|
|
|
455
496
|
declare interface FlowplayerUMDBase {
|
|
@@ -550,6 +591,10 @@ declare const GRABBING = "is-grabbing";
|
|
|
550
591
|
|
|
551
592
|
declare const HAS_POSTER = "has-poster";
|
|
552
593
|
|
|
594
|
+
declare type HasGlobalSrcExtensios<PluginSrcs extends unknown[]> = ArrayToIntersection<PickGlobalSrcExtension<PluginSrcs>>;
|
|
595
|
+
|
|
596
|
+
declare type HasSrcExtensions<PluginBareConfigs extends unknown[]> = TupleToUnion<PickSrcExtensions<PluginBareConfigs>> extends never ? false : true;
|
|
597
|
+
|
|
553
598
|
declare const HOVERED = "is-hovered";
|
|
554
599
|
|
|
555
600
|
declare const IN_VIEWPORT = "is-in-viewport";
|
|
@@ -659,26 +704,31 @@ PluginPlayer extends PlayerWith<_AttachedEventCheck>> extends Plugin_2<PluginOwn
|
|
|
659
704
|
|
|
660
705
|
declare const LOADING = "is-loading";
|
|
661
706
|
|
|
662
|
-
declare type
|
|
663
|
-
[PluginType in keyof
|
|
707
|
+
declare type MapToBareConfigs<Plugins extends PluginCtor[]> = {
|
|
708
|
+
[PluginType in keyof Plugins]: ExtractBareConfig<Plugins[PluginType]>;
|
|
664
709
|
};
|
|
665
710
|
|
|
666
|
-
declare type
|
|
667
|
-
[
|
|
711
|
+
declare type MapToPlayerExtensions<Plugins extends PluginCtor[]> = {
|
|
712
|
+
[PluginIndex in keyof Plugins]: ExtractPluginPlayerExtension<Plugins[PluginIndex]>;
|
|
668
713
|
};
|
|
669
714
|
|
|
670
715
|
declare const MENU_OPENED = "has-menu-opened";
|
|
671
716
|
|
|
672
|
-
|
|
717
|
+
/**
|
|
718
|
+
* Combines plugin config and returns a type derived from Config
|
|
719
|
+
*/
|
|
720
|
+
declare type MergeConfigs<Plugins extends PluginCtor[]> = MergePluginConfigs<MapToBareConfigs<Plugins>>;
|
|
721
|
+
|
|
722
|
+
declare type MergePlayerExtensions<Plugins extends PluginCtor[]> = ArrayToIntersection<MapToPlayerExtensions<Plugins>>;
|
|
673
723
|
|
|
674
|
-
declare type
|
|
724
|
+
declare type MergePluginConfigs<PluginBareConfigs extends unknown[]> = HasSrcExtensions<PluginBareConfigs> extends true ? ConfigWithSourceExtensions<PluginBareConfigs> : ConfigWith<ArrayToIntersection<PluginBareConfigs>>;
|
|
675
725
|
|
|
676
726
|
/**
|
|
677
727
|
* @public
|
|
678
728
|
* This plugin allows you to send overlay messages to the player.
|
|
679
729
|
* See {@link https://developer.wowza.com/docs/wowza-flowplayer/plugins/message-overlays/ | Official Documentation}
|
|
680
730
|
*/
|
|
681
|
-
declare const Message: PluginCtor<Config
|
|
731
|
+
declare const Message: PluginCtor<NoInfer<Config>, NoInfer<MessagePlayer>> & NoInfer<MessageAPI>;
|
|
682
732
|
export default Message;
|
|
683
733
|
|
|
684
734
|
/**
|
|
@@ -818,8 +868,6 @@ declare const NO_CONTROLS = "no-controls";
|
|
|
818
868
|
|
|
819
869
|
declare const NO_DVR = "no-timeline";
|
|
820
870
|
|
|
821
|
-
declare type NoInfer_2<T> = [T][T extends any ? 0 : never];
|
|
822
|
-
|
|
823
871
|
/* Excluded from this release type: NON_RECOVERABLE_ERROR */
|
|
824
872
|
|
|
825
873
|
/* Excluded from this release type: NonRecoverableErrorEventDetail */
|
|
@@ -838,6 +886,7 @@ declare type OVPMetadata = {
|
|
|
838
886
|
category_name?: string;
|
|
839
887
|
duration?: number;
|
|
840
888
|
tags?: string;
|
|
889
|
+
playlist_title?: string;
|
|
841
890
|
};
|
|
842
891
|
|
|
843
892
|
/**
|
|
@@ -853,6 +902,26 @@ PAUSE = "pause";
|
|
|
853
902
|
|
|
854
903
|
declare const PAUSED = "is-paused";
|
|
855
904
|
|
|
905
|
+
declare type PickGlobalSrcExtension<PluginSrcs extends unknown[]> = {
|
|
906
|
+
[Index in keyof PluginSrcs]: PluginSrcs[Index] extends {
|
|
907
|
+
type: string;
|
|
908
|
+
} ? unknown : PluginSrcs[Index];
|
|
909
|
+
};
|
|
910
|
+
|
|
911
|
+
/**
|
|
912
|
+
* Maps incoming array to the src extension type
|
|
913
|
+
* @example
|
|
914
|
+
* ```
|
|
915
|
+
* PickSrcExtensions<[
|
|
916
|
+
* {configProp: boolean, src: UnsafeSource<{srcProp: boolean}>},
|
|
917
|
+
* {}
|
|
918
|
+
* ]> // = [{srcProp: boolean}, never]
|
|
919
|
+
* ```
|
|
920
|
+
*/
|
|
921
|
+
declare type PickSrcExtensions<PluginBareConfigs extends unknown[]> = {
|
|
922
|
+
[PluginType in keyof PluginBareConfigs]: ExtractSrcExtension<PluginBareConfigs[PluginType]>;
|
|
923
|
+
};
|
|
924
|
+
|
|
856
925
|
/**
|
|
857
926
|
* @public
|
|
858
927
|
*/
|
|
@@ -974,6 +1043,8 @@ declare type PlayerCustomEventsDetailMap = PlayerEmittableCustomEventsDetailMap
|
|
|
974
1043
|
[DVR]: DvrEventDetail;
|
|
975
1044
|
[RETRY]: RetryEventDetail;
|
|
976
1045
|
[RECOVER]: RecoverEventDetail;
|
|
1046
|
+
[QUALITIES]: QualitiesEventDetail;
|
|
1047
|
+
[QUALITY_CHANGE]: QualityChangeEventDetail;
|
|
977
1048
|
/* Excluded from this release type: audioonlysource */
|
|
978
1049
|
/* Excluded from this release type: renderplugin */
|
|
979
1050
|
/* Excluded from this release type: "seek:queued" */
|
|
@@ -1030,7 +1101,10 @@ declare type PlayerCustomEventsOverloads = {
|
|
|
1030
1101
|
* Emitted when the set of underlying qualities has changed.
|
|
1031
1102
|
*/
|
|
1032
1103
|
on(event: typeof QUALITIES, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof QUALITIES]>) => void): Player;
|
|
1033
|
-
|
|
1104
|
+
/**
|
|
1105
|
+
* Emitted when the media changes quality.
|
|
1106
|
+
*/
|
|
1107
|
+
on(event: typeof QUALITY_CHANGE, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof QUALITY_CHANGE]>) => void): Player;
|
|
1034
1108
|
/* Excluded from this release type: on */
|
|
1035
1109
|
/**
|
|
1036
1110
|
* Listen to this event to create a recommendations grid using the data passed with the event.
|
|
@@ -1085,7 +1159,6 @@ declare type PlayerCustomEventsOverloads = {
|
|
|
1085
1159
|
/* Excluded from this release type: emit */
|
|
1086
1160
|
/* Excluded from this release type: emit */
|
|
1087
1161
|
/* Excluded from this release type: emit */
|
|
1088
|
-
/* Excluded from this release type: emit */
|
|
1089
1162
|
};
|
|
1090
1163
|
|
|
1091
1164
|
declare type PlayerEmittableCustomEventsDetailMap = {
|
|
@@ -1093,7 +1166,6 @@ declare type PlayerEmittableCustomEventsDetailMap = {
|
|
|
1093
1166
|
[CONTEXT_MENU]: ContextMenuEventDetail;
|
|
1094
1167
|
[VIEW_ENTER]: ViewEnterEventDetail;
|
|
1095
1168
|
[VIEW_LEAVE]: ViewLeaveEventDetail;
|
|
1096
|
-
[QUALITIES]: QualitiesEventDetail;
|
|
1097
1169
|
[RECOMMENDATIONS_READY]: RecommendationsReadyEventDetail;
|
|
1098
1170
|
};
|
|
1099
1171
|
|
|
@@ -1195,11 +1267,16 @@ PROGRESS = "progress";
|
|
|
1195
1267
|
/**
|
|
1196
1268
|
* @public
|
|
1197
1269
|
*/
|
|
1198
|
-
declare type QselOption = {
|
|
1199
|
-
height: number;
|
|
1270
|
+
declare type QselOption = (Level & {
|
|
1200
1271
|
level: number;
|
|
1201
|
-
|
|
1202
|
-
|
|
1272
|
+
}) | BitrateInfo | {
|
|
1273
|
+
name: string | number;
|
|
1274
|
+
encodingId: string;
|
|
1275
|
+
spatialLayerId: number;
|
|
1276
|
+
temporalLayerId: number;
|
|
1277
|
+
maxSpatialLayerId: number;
|
|
1278
|
+
maxTemporalLayerId: number;
|
|
1279
|
+
height: number;
|
|
1203
1280
|
width: number;
|
|
1204
1281
|
};
|
|
1205
1282
|
|
|
@@ -1223,9 +1300,29 @@ QUALITIES = "qualities";
|
|
|
1223
1300
|
*/
|
|
1224
1301
|
declare type QualitiesEventDetail = QselOption[];
|
|
1225
1302
|
|
|
1226
|
-
|
|
1303
|
+
/**
|
|
1304
|
+
* @public
|
|
1305
|
+
* emitted whenever the media changes quality
|
|
1306
|
+
*/
|
|
1307
|
+
declare const /**
|
|
1308
|
+
@public
|
|
1309
|
+
* when a new player is inserted into the HTML
|
|
1310
|
+
*/ /**
|
|
1311
|
+
* @public
|
|
1312
|
+
* emitted whenever the media changes quality
|
|
1313
|
+
*/
|
|
1314
|
+
QUALITY_CHANGE = "qualitychange";
|
|
1227
1315
|
|
|
1228
|
-
|
|
1316
|
+
/**
|
|
1317
|
+
* @public
|
|
1318
|
+
*/
|
|
1319
|
+
declare type QualityChangeEventDetail = {
|
|
1320
|
+
before: Level | BitrateInfo;
|
|
1321
|
+
after: Level | BitrateInfo;
|
|
1322
|
+
plugin: string;
|
|
1323
|
+
automatic: boolean;
|
|
1324
|
+
downscale: boolean;
|
|
1325
|
+
};
|
|
1229
1326
|
|
|
1230
1327
|
declare enum QualityOpts {
|
|
1231
1328
|
LOW = 1,
|
|
@@ -1436,14 +1533,14 @@ declare type SourceEventDetail = SourceObj;
|
|
|
1436
1533
|
/**
|
|
1437
1534
|
* @public
|
|
1438
1535
|
*/
|
|
1439
|
-
declare type SourceObj = {
|
|
1536
|
+
declare type SourceObj<T = unknown> = {
|
|
1440
1537
|
src?: SourceStr;
|
|
1441
1538
|
/**
|
|
1442
1539
|
* the MIME type (example `video/mp4` or `application/x-mpegurl`)
|
|
1443
1540
|
*/
|
|
1444
1541
|
type?: string;
|
|
1445
1542
|
drm?: DRMSourceConfiguration;
|
|
1446
|
-
};
|
|
1543
|
+
} & T;
|
|
1447
1544
|
|
|
1448
1545
|
/**
|
|
1449
1546
|
* @public
|
|
@@ -1570,7 +1667,7 @@ declare const TV = "is-tv";
|
|
|
1570
1667
|
/**
|
|
1571
1668
|
* @public
|
|
1572
1669
|
*/
|
|
1573
|
-
declare type UnsafeSource = SourceStr | SourceObj | Array<SourceStr | SourceObj
|
|
1670
|
+
declare type UnsafeSource<SrcMixin = unknown> = SourceStr | SourceObj<SrcMixin> | Array<SourceStr | SourceObj<SrcMixin>>;
|
|
1574
1671
|
|
|
1575
1672
|
/**
|
|
1576
1673
|
* @public
|
|
@@ -1666,9 +1763,6 @@ declare const WILL_PLAY = "will-play";
|
|
|
1666
1763
|
|
|
1667
1764
|
declare const WILL_SEEK = "will-seek";
|
|
1668
1765
|
|
|
1669
|
-
declare type WithOpts<PluginPlayer extends Player = Player, PluginConfig extends Config = Config> = PluginPlayer
|
|
1670
|
-
opts: PluginConfig;
|
|
1671
|
-
setOpts(config: PluginConfig): void;
|
|
1672
|
-
};
|
|
1766
|
+
declare type WithOpts<PluginPlayer extends Player = Player, PluginConfig extends Config = Config> = SetFieldType<SetFieldType<PluginPlayer, "opts", PluginConfig>, "setOpts", (config: PluginConfig) => void>;
|
|
1673
1767
|
|
|
1674
1768
|
export { }
|
package/plugins/ovp.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
|
/**
|
|
@@ -399,6 +427,7 @@ declare namespace events_2 {
|
|
|
399
427
|
SOURCE,
|
|
400
428
|
REAP,
|
|
401
429
|
QUALITIES,
|
|
430
|
+
QUALITY_CHANGE,
|
|
402
431
|
VIDEO_TRACKS,
|
|
403
432
|
SET_QUALITY,
|
|
404
433
|
VIDEO_TRACK_SELECT,
|
|
@@ -414,8 +443,20 @@ declare namespace events_2 {
|
|
|
414
443
|
}
|
|
415
444
|
}
|
|
416
445
|
|
|
446
|
+
declare type ExtractBareConfig<Plugins extends PluginCtor> = Plugins extends PluginCtor<ConfigWith<infer ConfigType>> ? ConfigType : never;
|
|
447
|
+
|
|
448
|
+
declare type ExtractPluginPlayerExtension<Plugin extends PluginCtor> = Plugin extends PluginCtor<infer _uConfigType, PlayerWith<infer PluginPlayer>> ? PluginPlayer : never;
|
|
449
|
+
|
|
417
450
|
declare type ExtractPureAPI<T> = T extends PlayerWith<infer PureAPI> ? PureAPI : never;
|
|
418
451
|
|
|
452
|
+
declare type ExtractSrcExtension<PluginBareConfig> = Get<PluginBareConfig, "src"> extends UnsafeSource<infer SrcMixinType> ? SrcMixinType : never;
|
|
453
|
+
|
|
454
|
+
declare type FilterNewSourceTypes<PluginSrcs extends unknown[]> = {
|
|
455
|
+
[Index in keyof PluginSrcs]: PluginSrcs[Index] extends {
|
|
456
|
+
type: string;
|
|
457
|
+
} ? PluginSrcs[Index] : never;
|
|
458
|
+
};
|
|
459
|
+
|
|
419
460
|
/**
|
|
420
461
|
* @public
|
|
421
462
|
*/
|
|
@@ -458,7 +499,7 @@ declare interface FlowplayerUMD extends FlowplayerUMDBase {
|
|
|
458
499
|
* Register plugins in flowplayer
|
|
459
500
|
* @returns flowplayer instance with registered plugins
|
|
460
501
|
*/
|
|
461
|
-
<PluginCtors extends PluginCtor[]>(...plugins: PluginCtors): FlowplayerUMDWithPlugins<
|
|
502
|
+
<PluginCtors extends PluginCtor[]>(...plugins: PluginCtors): FlowplayerUMDWithPlugins<MergeConfigs<PluginCtors>, PlayerWith<MergePlayerExtensions<PluginCtors>>>;
|
|
462
503
|
}
|
|
463
504
|
|
|
464
505
|
declare interface FlowplayerUMDBase {
|
|
@@ -559,6 +600,10 @@ declare const GRABBING = "is-grabbing";
|
|
|
559
600
|
|
|
560
601
|
declare const HAS_POSTER = "has-poster";
|
|
561
602
|
|
|
603
|
+
declare type HasGlobalSrcExtensios<PluginSrcs extends unknown[]> = ArrayToIntersection<PickGlobalSrcExtension<PluginSrcs>>;
|
|
604
|
+
|
|
605
|
+
declare type HasSrcExtensions<PluginBareConfigs extends unknown[]> = TupleToUnion<PickSrcExtensions<PluginBareConfigs>> extends never ? false : true;
|
|
606
|
+
|
|
562
607
|
declare const HOVERED = "is-hovered";
|
|
563
608
|
|
|
564
609
|
declare const IN_VIEWPORT = "is-in-viewport";
|
|
@@ -668,19 +713,24 @@ PluginPlayer extends PlayerWith<_AttachedEventCheck>> extends Plugin_2<PluginOwn
|
|
|
668
713
|
|
|
669
714
|
declare const LOADING = "is-loading";
|
|
670
715
|
|
|
671
|
-
declare type
|
|
672
|
-
[PluginType in keyof
|
|
716
|
+
declare type MapToBareConfigs<Plugins extends PluginCtor[]> = {
|
|
717
|
+
[PluginType in keyof Plugins]: ExtractBareConfig<Plugins[PluginType]>;
|
|
673
718
|
};
|
|
674
719
|
|
|
675
|
-
declare type
|
|
676
|
-
[
|
|
720
|
+
declare type MapToPlayerExtensions<Plugins extends PluginCtor[]> = {
|
|
721
|
+
[PluginIndex in keyof Plugins]: ExtractPluginPlayerExtension<Plugins[PluginIndex]>;
|
|
677
722
|
};
|
|
678
723
|
|
|
679
724
|
declare const MENU_OPENED = "has-menu-opened";
|
|
680
725
|
|
|
681
|
-
|
|
726
|
+
/**
|
|
727
|
+
* Combines plugin config and returns a type derived from Config
|
|
728
|
+
*/
|
|
729
|
+
declare type MergeConfigs<Plugins extends PluginCtor[]> = MergePluginConfigs<MapToBareConfigs<Plugins>>;
|
|
730
|
+
|
|
731
|
+
declare type MergePlayerExtensions<Plugins extends PluginCtor[]> = ArrayToIntersection<MapToPlayerExtensions<Plugins>>;
|
|
682
732
|
|
|
683
|
-
declare type
|
|
733
|
+
declare type MergePluginConfigs<PluginBareConfigs extends unknown[]> = HasSrcExtensions<PluginBareConfigs> extends true ? ConfigWithSourceExtensions<PluginBareConfigs> : ConfigWith<ArrayToIntersection<PluginBareConfigs>>;
|
|
684
734
|
|
|
685
735
|
/**
|
|
686
736
|
* @public
|
|
@@ -775,8 +825,6 @@ declare const NO_CONTROLS = "no-controls";
|
|
|
775
825
|
|
|
776
826
|
declare const NO_DVR = "no-timeline";
|
|
777
827
|
|
|
778
|
-
declare type NoInfer_2<T> = [T][T extends any ? 0 : never];
|
|
779
|
-
|
|
780
828
|
/* Excluded from this release type: NON_RECOVERABLE_ERROR */
|
|
781
829
|
|
|
782
830
|
/* Excluded from this release type: NonRecoverableErrorEventDetail */
|
|
@@ -787,7 +835,7 @@ declare type NoInfer_2<T> = [T][T extends any ? 0 : never];
|
|
|
787
835
|
* @public
|
|
788
836
|
* OVP plugin
|
|
789
837
|
*/
|
|
790
|
-
declare const OVP: PluginCtor<OVPConfig
|
|
838
|
+
declare const OVP: PluginCtor<NoInfer<OVPConfig>, NoInfer<OVPPlayer>>;
|
|
791
839
|
export default OVP;
|
|
792
840
|
|
|
793
841
|
/**
|
|
@@ -810,6 +858,7 @@ declare type OVPMetadata = {
|
|
|
810
858
|
category_name?: string;
|
|
811
859
|
duration?: number;
|
|
812
860
|
tags?: string;
|
|
861
|
+
playlist_title?: string;
|
|
813
862
|
};
|
|
814
863
|
|
|
815
864
|
/**
|
|
@@ -833,6 +882,26 @@ PAUSE = "pause";
|
|
|
833
882
|
|
|
834
883
|
declare const PAUSED = "is-paused";
|
|
835
884
|
|
|
885
|
+
declare type PickGlobalSrcExtension<PluginSrcs extends unknown[]> = {
|
|
886
|
+
[Index in keyof PluginSrcs]: PluginSrcs[Index] extends {
|
|
887
|
+
type: string;
|
|
888
|
+
} ? unknown : PluginSrcs[Index];
|
|
889
|
+
};
|
|
890
|
+
|
|
891
|
+
/**
|
|
892
|
+
* Maps incoming array to the src extension type
|
|
893
|
+
* @example
|
|
894
|
+
* ```
|
|
895
|
+
* PickSrcExtensions<[
|
|
896
|
+
* {configProp: boolean, src: UnsafeSource<{srcProp: boolean}>},
|
|
897
|
+
* {}
|
|
898
|
+
* ]> // = [{srcProp: boolean}, never]
|
|
899
|
+
* ```
|
|
900
|
+
*/
|
|
901
|
+
declare type PickSrcExtensions<PluginBareConfigs extends unknown[]> = {
|
|
902
|
+
[PluginType in keyof PluginBareConfigs]: ExtractSrcExtension<PluginBareConfigs[PluginType]>;
|
|
903
|
+
};
|
|
904
|
+
|
|
836
905
|
/**
|
|
837
906
|
* @public
|
|
838
907
|
*/
|
|
@@ -954,6 +1023,8 @@ declare type PlayerCustomEventsDetailMap = PlayerEmittableCustomEventsDetailMap
|
|
|
954
1023
|
[DVR]: DvrEventDetail;
|
|
955
1024
|
[RETRY]: RetryEventDetail;
|
|
956
1025
|
[RECOVER]: RecoverEventDetail;
|
|
1026
|
+
[QUALITIES]: QualitiesEventDetail;
|
|
1027
|
+
[QUALITY_CHANGE]: QualityChangeEventDetail;
|
|
957
1028
|
/* Excluded from this release type: audioonlysource */
|
|
958
1029
|
/* Excluded from this release type: renderplugin */
|
|
959
1030
|
/* Excluded from this release type: "seek:queued" */
|
|
@@ -1010,7 +1081,10 @@ declare type PlayerCustomEventsOverloads = {
|
|
|
1010
1081
|
* Emitted when the set of underlying qualities has changed.
|
|
1011
1082
|
*/
|
|
1012
1083
|
on(event: typeof QUALITIES, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof QUALITIES]>) => void): Player;
|
|
1013
|
-
|
|
1084
|
+
/**
|
|
1085
|
+
* Emitted when the media changes quality.
|
|
1086
|
+
*/
|
|
1087
|
+
on(event: typeof QUALITY_CHANGE, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof QUALITY_CHANGE]>) => void): Player;
|
|
1014
1088
|
/* Excluded from this release type: on */
|
|
1015
1089
|
/**
|
|
1016
1090
|
* Listen to this event to create a recommendations grid using the data passed with the event.
|
|
@@ -1065,7 +1139,6 @@ declare type PlayerCustomEventsOverloads = {
|
|
|
1065
1139
|
/* Excluded from this release type: emit */
|
|
1066
1140
|
/* Excluded from this release type: emit */
|
|
1067
1141
|
/* Excluded from this release type: emit */
|
|
1068
|
-
/* Excluded from this release type: emit */
|
|
1069
1142
|
};
|
|
1070
1143
|
|
|
1071
1144
|
declare type PlayerEmittableCustomEventsDetailMap = {
|
|
@@ -1073,7 +1146,6 @@ declare type PlayerEmittableCustomEventsDetailMap = {
|
|
|
1073
1146
|
[CONTEXT_MENU]: ContextMenuEventDetail;
|
|
1074
1147
|
[VIEW_ENTER]: ViewEnterEventDetail;
|
|
1075
1148
|
[VIEW_LEAVE]: ViewLeaveEventDetail;
|
|
1076
|
-
[QUALITIES]: QualitiesEventDetail;
|
|
1077
1149
|
[RECOMMENDATIONS_READY]: RecommendationsReadyEventDetail;
|
|
1078
1150
|
};
|
|
1079
1151
|
|
|
@@ -1182,11 +1254,16 @@ PROGRESS = "progress";
|
|
|
1182
1254
|
/**
|
|
1183
1255
|
* @public
|
|
1184
1256
|
*/
|
|
1185
|
-
declare type QselOption = {
|
|
1186
|
-
height: number;
|
|
1257
|
+
declare type QselOption = (Level & {
|
|
1187
1258
|
level: number;
|
|
1188
|
-
|
|
1189
|
-
|
|
1259
|
+
}) | BitrateInfo | {
|
|
1260
|
+
name: string | number;
|
|
1261
|
+
encodingId: string;
|
|
1262
|
+
spatialLayerId: number;
|
|
1263
|
+
temporalLayerId: number;
|
|
1264
|
+
maxSpatialLayerId: number;
|
|
1265
|
+
maxTemporalLayerId: number;
|
|
1266
|
+
height: number;
|
|
1190
1267
|
width: number;
|
|
1191
1268
|
};
|
|
1192
1269
|
|
|
@@ -1210,9 +1287,29 @@ QUALITIES = "qualities";
|
|
|
1210
1287
|
*/
|
|
1211
1288
|
declare type QualitiesEventDetail = QselOption[];
|
|
1212
1289
|
|
|
1213
|
-
|
|
1290
|
+
/**
|
|
1291
|
+
* @public
|
|
1292
|
+
* emitted whenever the media changes quality
|
|
1293
|
+
*/
|
|
1294
|
+
declare const /**
|
|
1295
|
+
@public
|
|
1296
|
+
* when a new player is inserted into the HTML
|
|
1297
|
+
*/ /**
|
|
1298
|
+
* @public
|
|
1299
|
+
* emitted whenever the media changes quality
|
|
1300
|
+
*/
|
|
1301
|
+
QUALITY_CHANGE = "qualitychange";
|
|
1214
1302
|
|
|
1215
|
-
|
|
1303
|
+
/**
|
|
1304
|
+
* @public
|
|
1305
|
+
*/
|
|
1306
|
+
declare type QualityChangeEventDetail = {
|
|
1307
|
+
before: Level | BitrateInfo;
|
|
1308
|
+
after: Level | BitrateInfo;
|
|
1309
|
+
plugin: string;
|
|
1310
|
+
automatic: boolean;
|
|
1311
|
+
downscale: boolean;
|
|
1312
|
+
};
|
|
1216
1313
|
|
|
1217
1314
|
declare enum QualityOpts {
|
|
1218
1315
|
LOW = 1,
|
|
@@ -1433,14 +1530,14 @@ declare type SourceEventDetail = SourceObj;
|
|
|
1433
1530
|
/**
|
|
1434
1531
|
* @public
|
|
1435
1532
|
*/
|
|
1436
|
-
declare type SourceObj = {
|
|
1533
|
+
declare type SourceObj<T = unknown> = {
|
|
1437
1534
|
src?: SourceStr;
|
|
1438
1535
|
/**
|
|
1439
1536
|
* the MIME type (example `video/mp4` or `application/x-mpegurl`)
|
|
1440
1537
|
*/
|
|
1441
1538
|
type?: string;
|
|
1442
1539
|
drm?: DRMSourceConfiguration;
|
|
1443
|
-
};
|
|
1540
|
+
} & T;
|
|
1444
1541
|
|
|
1445
1542
|
/**
|
|
1446
1543
|
* @public
|
|
@@ -1567,7 +1664,7 @@ declare const TV = "is-tv";
|
|
|
1567
1664
|
/**
|
|
1568
1665
|
* @public
|
|
1569
1666
|
*/
|
|
1570
|
-
declare type UnsafeSource = SourceStr | SourceObj | Array<SourceStr | SourceObj
|
|
1667
|
+
declare type UnsafeSource<SrcMixin = unknown> = SourceStr | SourceObj<SrcMixin> | Array<SourceStr | SourceObj<SrcMixin>>;
|
|
1571
1668
|
|
|
1572
1669
|
/**
|
|
1573
1670
|
* @public
|
|
@@ -1663,9 +1760,6 @@ declare const WILL_PLAY = "will-play";
|
|
|
1663
1760
|
|
|
1664
1761
|
declare const WILL_SEEK = "will-seek";
|
|
1665
1762
|
|
|
1666
|
-
declare type WithOpts<PluginPlayer extends Player = Player, PluginConfig extends Config = Config> = PluginPlayer
|
|
1667
|
-
opts: PluginConfig;
|
|
1668
|
-
setOpts(config: PluginConfig): void;
|
|
1669
|
-
};
|
|
1763
|
+
declare type WithOpts<PluginPlayer extends Player = Player, PluginConfig extends Config = Config> = SetFieldType<SetFieldType<PluginPlayer, "opts", PluginConfig>, "setOpts", (config: PluginConfig) => void>;
|
|
1670
1764
|
|
|
1671
1765
|
export { }
|