@flowplayer/player 3.11.1 → 3.11.2-rc.0
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.js +1 -1
- package/default.js +1 -1
- package/embed.js +2 -2
- package/index.d.ts +0 -3
- package/package.json +39 -1
- package/plugins/ads.d.ts +775 -0
- package/plugins/ads.js +1 -1
- package/plugins/airplay.d.ts +377 -0
- package/plugins/analytics.d.ts +242 -0
- package/plugins/analytics.js +1 -1
- package/plugins/asel.d.ts +360 -0
- package/plugins/audio.d.ts +347 -0
- package/plugins/chapters.d.ts +391 -0
- package/plugins/chromecast.d.ts +422 -0
- package/plugins/consent.d.ts +373 -0
- package/plugins/context-menu.d.ts +212 -0
- package/plugins/cuepoints.d.ts +0 -3
- package/plugins/dash.d.ts +235 -0
- package/plugins/drm.d.ts +248 -0
- package/plugins/endscreen.d.ts +407 -0
- package/plugins/fas.d.ts +364 -0
- package/plugins/float-on-scroll.d.ts +367 -0
- package/plugins/ga4.d.ts +454 -0
- package/plugins/gemius.d.ts +385 -0
- package/plugins/google-analytics.d.ts +456 -0
- package/plugins/health.d.ts +385 -0
- package/plugins/health.js +1 -1
- package/plugins/hls.d.ts +229 -0
- package/plugins/id3.d.ts +198 -0
- package/plugins/iframe.d.ts +356 -0
- package/plugins/keyboard.d.ts +189 -0
- package/plugins/media-session.d.ts +189 -0
- package/plugins/message.d.ts +193 -0
- package/plugins/ovp.d.ts +411 -0
- package/plugins/playlist.d.ts +394 -0
- package/plugins/preview.d.ts +243 -0
- package/plugins/qsel.d.ts +352 -0
- package/plugins/qul.d.ts +220 -0
- package/plugins/rts.d.ts +273 -0
- package/plugins/share.d.ts +361 -0
- package/plugins/speed.d.ts +346 -0
- package/plugins/ssai.d.ts +412 -0
- package/plugins/ssai.js +1 -1
- package/plugins/subtitles.d.ts +362 -0
- package/plugins/thumbnails.d.ts +375 -0
- package/plugins/tizen.d.ts +430 -0
- package/plugins/vtsel.d.ts +348 -0
- package/plugins/webos.d.ts +430 -0
- package/util/loader.d.ts +0 -3
package/plugins/rts.d.ts
ADDED
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import type { MediaKeyFunc } from 'hls.js';
|
|
2
|
+
import { MediaStreamSource } from '@millicast/sdk';
|
|
3
|
+
import type { ViewerCount } from '@millicast/sdk';
|
|
4
|
+
|
|
5
|
+
declare type BitOpts = number;
|
|
6
|
+
|
|
7
|
+
declare interface Config {
|
|
8
|
+
src?: UnsafeSource;
|
|
9
|
+
preload?: "none" | "metadata" | "auto";
|
|
10
|
+
controls?: boolean;
|
|
11
|
+
lang?: string;
|
|
12
|
+
start_time?: number;
|
|
13
|
+
autopause?: boolean;
|
|
14
|
+
rewind?: boolean;
|
|
15
|
+
loop?: boolean;
|
|
16
|
+
seamless?: boolean;
|
|
17
|
+
retry?: boolean;
|
|
18
|
+
autoplay?: BitOpts;
|
|
19
|
+
start_quality?: BitOpts;
|
|
20
|
+
live?: boolean;
|
|
21
|
+
poster?: string;
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
muted?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* is src handled by one of plugins loaders
|
|
26
|
+
*/
|
|
27
|
+
is_native?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* bitflags for UI options
|
|
30
|
+
*/
|
|
31
|
+
ui?: BitOpts;
|
|
32
|
+
/**
|
|
33
|
+
* your user access token
|
|
34
|
+
*/
|
|
35
|
+
token?: string;
|
|
36
|
+
/**
|
|
37
|
+
* manually configured duration for pre-rendering usually
|
|
38
|
+
*/
|
|
39
|
+
duration?: number;
|
|
40
|
+
/**
|
|
41
|
+
* can the content be seeked to any position
|
|
42
|
+
*/
|
|
43
|
+
seekable?: boolean;
|
|
44
|
+
multiplay?: boolean;
|
|
45
|
+
ratio?: number | string;
|
|
46
|
+
logo?: string;
|
|
47
|
+
logo_href?: string;
|
|
48
|
+
logo_alt_text?: string;
|
|
49
|
+
title?: string;
|
|
50
|
+
description?: string;
|
|
51
|
+
/**
|
|
52
|
+
* the number of seconds to have in the buffer before dvr is activated
|
|
53
|
+
*/
|
|
54
|
+
seconds_to_dvr?: number;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
declare type DeviceId = string;
|
|
58
|
+
|
|
59
|
+
declare type DRM_KEYSYSTEM = "com.widevine.alpha" | "com.microsoft.playready" | "org.w3.clearkey" | "com.apple.fps.1_0";
|
|
60
|
+
|
|
61
|
+
declare type DRMConfiguration = {
|
|
62
|
+
license_server: string;
|
|
63
|
+
http_headers?: Record<string, string>;
|
|
64
|
+
certificate?: string;
|
|
65
|
+
vendor?: string | DRMVendorImplementation;
|
|
66
|
+
request_media_key_system_access_function?: MediaKeyFunc;
|
|
67
|
+
query_params?: Record<string, string>;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
declare type DRMSourceConfiguration = {
|
|
71
|
+
[keysystem in DRM_KEYSYSTEM]?: DRMConfiguration;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
declare type DRMVendorImplementation = {
|
|
75
|
+
fairplay_fetch_certificate: (url: string, cb: (certificate_data: Uint8Array) => void) => void;
|
|
76
|
+
fairplay_request_license: (url: string, params: {
|
|
77
|
+
message: any;
|
|
78
|
+
assetId: string;
|
|
79
|
+
}, cb: (license_data: Uint8Array) => void) => void;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
declare namespace events {
|
|
83
|
+
export {
|
|
84
|
+
STATUS,
|
|
85
|
+
VIEWER_COUNT
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
declare type FlowplayerCustomElementRegistry = Map<string, string>;
|
|
90
|
+
|
|
91
|
+
declare interface FPEvent<T> extends CustomEvent<T> {
|
|
92
|
+
/**
|
|
93
|
+
* @deprecated
|
|
94
|
+
the data attribute has been migrated to details to match the CustomEvent spec
|
|
95
|
+
more info: https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent
|
|
96
|
+
*/
|
|
97
|
+
data?: T;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
declare type JSONPlayer = any;
|
|
101
|
+
|
|
102
|
+
declare type KeyValue = Record<string, any>;
|
|
103
|
+
|
|
104
|
+
declare interface Loader<PluginOwnConfig extends KeyValue = KeyValue> extends Plugin_2<PluginOwnConfig> {
|
|
105
|
+
onload<T = KeyValue>(config: PluginConfig<T>, root: PlayerRoot, video: Player, src?: SourceObj): void;
|
|
106
|
+
wants<S = SourceObj, T = KeyValue>(srcString: SourceStr, srcObj: S, config: PluginConfig<T>): boolean;
|
|
107
|
+
wants<S = KeyValue, T = KeyValue>(srcString: SourceStr, srcObj: SourceWith<S>, config: PluginConfig<T>): boolean;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
declare interface Logger {
|
|
111
|
+
(...args: any[]): void;
|
|
112
|
+
log(...args: any[]): void;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
declare namespace Millicast {
|
|
116
|
+
type Src = {
|
|
117
|
+
streamName: string;
|
|
118
|
+
streamAccountId: string;
|
|
119
|
+
subscriberToken?: string;
|
|
120
|
+
type: "wowza/rts";
|
|
121
|
+
};
|
|
122
|
+
type ViewerCountEvent = {
|
|
123
|
+
type: string;
|
|
124
|
+
name: "viewercount";
|
|
125
|
+
data: ViewerCount;
|
|
126
|
+
};
|
|
127
|
+
type ActiveEvent = {
|
|
128
|
+
type: string;
|
|
129
|
+
name: "active";
|
|
130
|
+
data: MediaStreamSource;
|
|
131
|
+
};
|
|
132
|
+
type InactiveEvent = {
|
|
133
|
+
type: string;
|
|
134
|
+
name: "inactive";
|
|
135
|
+
data: MediaStreamSource;
|
|
136
|
+
};
|
|
137
|
+
type BroadcastEvent = ViewerCountEvent | ActiveEvent | InactiveEvent;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
declare interface Player extends HTMLVideoElement {
|
|
141
|
+
renderPlugin: (pluginContainer: HTMLElement) => void;
|
|
142
|
+
toggleDisable: (flag: boolean) => void;
|
|
143
|
+
original_src: string;
|
|
144
|
+
root: PlayerRoot;
|
|
145
|
+
playerState: Record<string, boolean>;
|
|
146
|
+
reaper: Map<string, any> | 0;
|
|
147
|
+
hasState(state: PlayerState): boolean;
|
|
148
|
+
transitionState(to: PlayerState, from: PlayerState, timer?: number): void;
|
|
149
|
+
togglePlay(on?: boolean): Promise<void>;
|
|
150
|
+
toggleFullScreen(on?: boolean, state_only?: boolean): void;
|
|
151
|
+
toggleMute(on?: boolean): void;
|
|
152
|
+
destroy(): void;
|
|
153
|
+
render(): void;
|
|
154
|
+
render(component: string, args: any[]): void;
|
|
155
|
+
createComponents(...args: string[]): HTMLElement[];
|
|
156
|
+
setOpts(config: Config): void;
|
|
157
|
+
setSrc(sources: UnsafeSource): Player;
|
|
158
|
+
on<T>(event: string | string[], handler: (e: FPEvent<T>) => void): Player;
|
|
159
|
+
once<T>(event: string, handler: (e: FPEvent<T>) => void): Player;
|
|
160
|
+
off<T>(event: string, handler: (e: FPEvent<T>) => void): Player;
|
|
161
|
+
poll<T>(event: string, data?: T): FPEvent<T>;
|
|
162
|
+
emit<T>(event: string, data?: T): Player;
|
|
163
|
+
setAttrs(attrs: Config): Player;
|
|
164
|
+
opt<T>(key: string, fallback?: T): T;
|
|
165
|
+
enqueueSeek(offset: number): any;
|
|
166
|
+
setState(state: string, flag: boolean): Player;
|
|
167
|
+
toJSON(): JSONPlayer;
|
|
168
|
+
i18n(k: string, fallback?: string): string;
|
|
169
|
+
deviceId(): DeviceId;
|
|
170
|
+
live_state: {
|
|
171
|
+
dvr?: boolean;
|
|
172
|
+
dvr_window?: number;
|
|
173
|
+
};
|
|
174
|
+
opts: Config;
|
|
175
|
+
plugins: Array<Plugin_2 | Loader>;
|
|
176
|
+
dvr_offset?: number;
|
|
177
|
+
message?: {
|
|
178
|
+
events: Record<string, string>;
|
|
179
|
+
};
|
|
180
|
+
disabled: boolean;
|
|
181
|
+
started?: boolean;
|
|
182
|
+
token: string;
|
|
183
|
+
tracks?: VideoTrack[];
|
|
184
|
+
_customElements: FlowplayerCustomElementRegistry;
|
|
185
|
+
_storage: Storage;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
declare type PlayerRoot = HTMLElement & {
|
|
189
|
+
prevWidth?: number;
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
declare type PlayerState = string;
|
|
193
|
+
|
|
194
|
+
declare interface Plugin_2<PluginOwnConfig extends KeyValue = KeyValue> {
|
|
195
|
+
/**
|
|
196
|
+
* a plugin must always implement the init method so a player instance knows how to initialize it
|
|
197
|
+
*/
|
|
198
|
+
init<T>(config: PluginConfig<T>, container: PlayerRoot, player: Player): void;
|
|
199
|
+
init(config: PluginConfig<PluginOwnConfig>, container: PlayerRoot, player: Player): void;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
declare type PluginConfig<T> = Config & T;
|
|
203
|
+
|
|
204
|
+
declare namespace RTS {
|
|
205
|
+
type Player = Player & {
|
|
206
|
+
rtsAdapter?: RTS.Adapter;
|
|
207
|
+
};
|
|
208
|
+
type Src = Millicast.Src | WowzaWebRTC.Src;
|
|
209
|
+
interface Adapter {
|
|
210
|
+
readonly log: Logger;
|
|
211
|
+
load(): void;
|
|
212
|
+
stop(): void;
|
|
213
|
+
}
|
|
214
|
+
type StatusMessage = {
|
|
215
|
+
status: Status;
|
|
216
|
+
message?: string;
|
|
217
|
+
data?: MediaStreamSource;
|
|
218
|
+
};
|
|
219
|
+
type ViewerCountEvent = {
|
|
220
|
+
viewerCount: number;
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
declare class RTSLoader implements Plugin_2 {
|
|
225
|
+
static events: typeof events;
|
|
226
|
+
static state: typeof Status;
|
|
227
|
+
readonly log: Logger;
|
|
228
|
+
engine?: RTS.Adapter;
|
|
229
|
+
constructor();
|
|
230
|
+
init(_config: Config, _root: PlayerRoot, player: RTS.Player): void;
|
|
231
|
+
onload(_config: Config, _root: PlayerRoot, video: RTS.Player, src: RTS.Src): void;
|
|
232
|
+
wants(_srcString: string, src: RTS.Src, _config: Config): boolean;
|
|
233
|
+
}
|
|
234
|
+
export default RTSLoader;
|
|
235
|
+
|
|
236
|
+
declare type SourceObj = {
|
|
237
|
+
src?: SourceStr;
|
|
238
|
+
type?: string;
|
|
239
|
+
drm?: DRMSourceConfiguration;
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
declare type SourceStr = string;
|
|
243
|
+
|
|
244
|
+
declare type SourceWith<T> = SourceObj & T;
|
|
245
|
+
|
|
246
|
+
declare const STATUS = "rts/status";
|
|
247
|
+
|
|
248
|
+
declare enum Status {
|
|
249
|
+
Idle = 0,
|
|
250
|
+
Receiving = 1
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
declare type UnsafeSource = SourceStr | SourceObj | Array<SourceStr | SourceObj>;
|
|
254
|
+
|
|
255
|
+
declare interface VideoTrack {
|
|
256
|
+
name: string;
|
|
257
|
+
data: any;
|
|
258
|
+
default: boolean;
|
|
259
|
+
selected: boolean;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
declare const VIEWER_COUNT = "rts/viewer-count";
|
|
263
|
+
|
|
264
|
+
declare namespace WowzaWebRTC {
|
|
265
|
+
type Src = {
|
|
266
|
+
sdpUrl: string;
|
|
267
|
+
applicationName: string;
|
|
268
|
+
streamName: string;
|
|
269
|
+
type: "wowza/webrtc";
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
export { }
|
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
import type { MediaKeyFunc } from 'hls.js';
|
|
2
|
+
|
|
3
|
+
declare type AnyPlugin<PluginOwnConfig extends KeyValue> = Plugin_2<PluginOwnConfig> | Loader<PluginOwnConfig>;
|
|
4
|
+
|
|
5
|
+
declare type ArrayToIntersection<T extends Array<unknown>> = T extends [infer Current, ...infer Remaining] ? Current & ArrayToIntersection<Remaining> : unknown;
|
|
6
|
+
|
|
7
|
+
declare type BitOpts = number;
|
|
8
|
+
|
|
9
|
+
declare type Component = {
|
|
10
|
+
onrender?: (config: Config, root: PlayerRoot, player: Player) => void;
|
|
11
|
+
onremove?: (config: Config, root: PlayerRoot, player: Player) => void;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
declare interface Components {
|
|
15
|
+
render(key: string, args: any[]): void;
|
|
16
|
+
remove(key: string, args: any[]): void;
|
|
17
|
+
put(key: string, args: Component): void;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
declare interface Config {
|
|
21
|
+
src?: UnsafeSource;
|
|
22
|
+
preload?: "none" | "metadata" | "auto";
|
|
23
|
+
controls?: boolean;
|
|
24
|
+
lang?: string;
|
|
25
|
+
start_time?: number;
|
|
26
|
+
autopause?: boolean;
|
|
27
|
+
rewind?: boolean;
|
|
28
|
+
loop?: boolean;
|
|
29
|
+
seamless?: boolean;
|
|
30
|
+
retry?: boolean;
|
|
31
|
+
autoplay?: BitOpts;
|
|
32
|
+
start_quality?: BitOpts;
|
|
33
|
+
live?: boolean;
|
|
34
|
+
poster?: string;
|
|
35
|
+
disabled?: boolean;
|
|
36
|
+
muted?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* is src handled by one of plugins loaders
|
|
39
|
+
*/
|
|
40
|
+
is_native?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* bitflags for UI options
|
|
43
|
+
*/
|
|
44
|
+
ui?: BitOpts;
|
|
45
|
+
/**
|
|
46
|
+
* your user access token
|
|
47
|
+
*/
|
|
48
|
+
token?: string;
|
|
49
|
+
/**
|
|
50
|
+
* manually configured duration for pre-rendering usually
|
|
51
|
+
*/
|
|
52
|
+
duration?: number;
|
|
53
|
+
/**
|
|
54
|
+
* can the content be seeked to any position
|
|
55
|
+
*/
|
|
56
|
+
seekable?: boolean;
|
|
57
|
+
multiplay?: boolean;
|
|
58
|
+
ratio?: number | string;
|
|
59
|
+
logo?: string;
|
|
60
|
+
logo_href?: string;
|
|
61
|
+
logo_alt_text?: string;
|
|
62
|
+
title?: string;
|
|
63
|
+
description?: string;
|
|
64
|
+
/**
|
|
65
|
+
* the number of seconds to have in the buffer before dvr is activated
|
|
66
|
+
*/
|
|
67
|
+
seconds_to_dvr?: number;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
declare namespace Configs {
|
|
71
|
+
export {
|
|
72
|
+
BitOpts,
|
|
73
|
+
FlowplayerCustomElementRegistry,
|
|
74
|
+
Config,
|
|
75
|
+
CustomConfig,
|
|
76
|
+
PluginConfig
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
declare type CustomConfig<T> = Config & T;
|
|
81
|
+
|
|
82
|
+
declare type DeviceId = string;
|
|
83
|
+
|
|
84
|
+
declare type DRM_KEYSYSTEM = "com.widevine.alpha" | "com.microsoft.playready" | "org.w3.clearkey" | "com.apple.fps.1_0";
|
|
85
|
+
|
|
86
|
+
declare type DRMConfiguration = {
|
|
87
|
+
license_server: string;
|
|
88
|
+
http_headers?: Record<string, string>;
|
|
89
|
+
certificate?: string;
|
|
90
|
+
vendor?: string | DRMVendorImplementation;
|
|
91
|
+
request_media_key_system_access_function?: MediaKeyFunc;
|
|
92
|
+
query_params?: Record<string, string>;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
declare type DRMSourceConfiguration = {
|
|
96
|
+
[keysystem in DRM_KEYSYSTEM]?: DRMConfiguration;
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
declare type DRMVendorImplementation = {
|
|
100
|
+
fairplay_fetch_certificate: (url: string, cb: (certificate_data: Uint8Array) => void) => void;
|
|
101
|
+
fairplay_request_license: (url: string, params: {
|
|
102
|
+
message: any;
|
|
103
|
+
assetId: string;
|
|
104
|
+
}, cb: (license_data: Uint8Array) => void) => void;
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
declare namespace Flowplayer {
|
|
108
|
+
type SourceStr = Sources.SourceStr;
|
|
109
|
+
type DRM_KEYSYSTEM = Sources.DRM_KEYSYSTEM;
|
|
110
|
+
type SourceObj = Sources.SourceObj;
|
|
111
|
+
type DRMSourceConfiguration = Sources.DRMSourceConfiguration;
|
|
112
|
+
type SourceWith<T> = Sources.SourceWith<T>;
|
|
113
|
+
type UnsafeSource = Sources.UnsafeSource;
|
|
114
|
+
type SourceList = Sources.SourceList;
|
|
115
|
+
type DRMConfiguration = Sources.DRMConfiguration;
|
|
116
|
+
type DRMVendorImplementation = Sources.DRMVendorImplementation;
|
|
117
|
+
type BitOpts = Configs.BitOpts;
|
|
118
|
+
type FlowplayerCustomElementRegistry = Configs.FlowplayerCustomElementRegistry;
|
|
119
|
+
interface Config extends Configs.Config {
|
|
120
|
+
}
|
|
121
|
+
type CustomConfig<T> = Configs.CustomConfig<T>;
|
|
122
|
+
type PluginConfig<T> = Configs.PluginConfig<T>;
|
|
123
|
+
interface VideoTrack extends Players.VideoTrack {
|
|
124
|
+
}
|
|
125
|
+
interface FPEvent<T> extends Players.FPEvent<T> {
|
|
126
|
+
}
|
|
127
|
+
type DeviceId = Players.DeviceId;
|
|
128
|
+
type JSONPlayer = Players.JSONPlayer;
|
|
129
|
+
type PlayerRoot = Players.PlayerRoot;
|
|
130
|
+
interface Player extends Players.Player {
|
|
131
|
+
}
|
|
132
|
+
type PlayerState = Players.PlayerState;
|
|
133
|
+
interface FlowplayerUMD extends FlowplayerUMDs.FlowplayerUMD {
|
|
134
|
+
}
|
|
135
|
+
interface Components extends FlowplayerUMDs.Components {
|
|
136
|
+
}
|
|
137
|
+
type Component = FlowplayerUMDs.Component;
|
|
138
|
+
enum AutoplayOpts {
|
|
139
|
+
OFF,
|
|
140
|
+
ON,
|
|
141
|
+
AUDIO_REQUIRED
|
|
142
|
+
}
|
|
143
|
+
enum QualityOpts {
|
|
144
|
+
LOW,
|
|
145
|
+
MEDIUM,
|
|
146
|
+
HIGH
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
declare type FlowplayerCustomElementRegistry = Map<string, string>;
|
|
151
|
+
|
|
152
|
+
declare interface FlowplayerUMD extends FlowplayerUMDBase {
|
|
153
|
+
(selector: string, config?: Config): Player;
|
|
154
|
+
(element: HTMLElement, config?: Config): Player;
|
|
155
|
+
<T>(selector: string, config?: CustomConfig<T>): Player;
|
|
156
|
+
<T>(element: HTMLElement, config?: CustomConfig<T>): Player;
|
|
157
|
+
<PluginCtors extends PluginCtor[]>(...plugins: PluginCtors): FlowplayerUMDWithPlugins<CustomConfig<MergeConfigs<PluginCtors>>>;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
declare interface FlowplayerUMDBase {
|
|
161
|
+
instances: Player[];
|
|
162
|
+
extensions: PluginCtor[];
|
|
163
|
+
events: Record<string, string>;
|
|
164
|
+
ads?: {
|
|
165
|
+
events: Record<string, string>;
|
|
166
|
+
};
|
|
167
|
+
states: Record<string, string>;
|
|
168
|
+
quality: typeof Flowplayer.QualityOpts;
|
|
169
|
+
commit: string;
|
|
170
|
+
version: string;
|
|
171
|
+
customElements: FlowplayerCustomElementRegistry;
|
|
172
|
+
defaultElements: Record<string, string>;
|
|
173
|
+
components: Components;
|
|
174
|
+
support: any;
|
|
175
|
+
autoplay: typeof Flowplayer.AutoplayOpts;
|
|
176
|
+
jwt: any;
|
|
177
|
+
loaders: any;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
declare namespace FlowplayerUMDs {
|
|
181
|
+
export {
|
|
182
|
+
FlowplayerUMD,
|
|
183
|
+
FlowplayerUMDWithPlugins,
|
|
184
|
+
Components,
|
|
185
|
+
Component
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
declare interface FlowplayerUMDWithPlugins<ConfigWithPlugins extends Config = Config> extends FlowplayerUMDBase {
|
|
190
|
+
(selector: string, config?: ConfigWithPlugins): Player;
|
|
191
|
+
(element: HTMLElement, config?: ConfigWithPlugins): Player;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
declare interface FPEvent<T> extends CustomEvent<T> {
|
|
195
|
+
/**
|
|
196
|
+
* @deprecated
|
|
197
|
+
the data attribute has been migrated to details to match the CustomEvent spec
|
|
198
|
+
more info: https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent
|
|
199
|
+
*/
|
|
200
|
+
data?: T;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
declare type JSONPlayer = any;
|
|
204
|
+
|
|
205
|
+
declare type KeyValue = Record<string, any>;
|
|
206
|
+
|
|
207
|
+
declare interface Loader<PluginOwnConfig extends KeyValue = KeyValue> extends Plugin_2<PluginOwnConfig> {
|
|
208
|
+
onload<T = KeyValue>(config: PluginConfig<T>, root: PlayerRoot, video: Player, src?: SourceObj): void;
|
|
209
|
+
wants<S = SourceObj, T = KeyValue>(srcString: SourceStr, srcObj: S, config: PluginConfig<T>): boolean;
|
|
210
|
+
wants<S = KeyValue, T = KeyValue>(srcString: SourceStr, srcObj: SourceWith<S>, config: PluginConfig<T>): boolean;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
declare type MapToConfigs<Arr extends PluginCtor[]> = {
|
|
214
|
+
[PluginType in keyof Arr]: Arr[PluginType] extends PluginCtor<infer ConfigType> ? ConfigType : never;
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
declare type MenuOption = {
|
|
218
|
+
text: string;
|
|
219
|
+
onclick: () => any;
|
|
220
|
+
icon?: HTMLElement;
|
|
221
|
+
selected?: boolean;
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
declare type MergeConfigs<Arr extends PluginCtor[]> = ArrayToIntersection<MapToConfigs<Arr>>;
|
|
225
|
+
|
|
226
|
+
declare interface Player extends HTMLVideoElement {
|
|
227
|
+
renderPlugin: (pluginContainer: HTMLElement) => void;
|
|
228
|
+
toggleDisable: (flag: boolean) => void;
|
|
229
|
+
original_src: string;
|
|
230
|
+
root: PlayerRoot;
|
|
231
|
+
playerState: Record<string, boolean>;
|
|
232
|
+
reaper: Map<string, any> | 0;
|
|
233
|
+
hasState(state: PlayerState): boolean;
|
|
234
|
+
transitionState(to: PlayerState, from: PlayerState, timer?: number): void;
|
|
235
|
+
togglePlay(on?: boolean): Promise<void>;
|
|
236
|
+
toggleFullScreen(on?: boolean, state_only?: boolean): void;
|
|
237
|
+
toggleMute(on?: boolean): void;
|
|
238
|
+
destroy(): void;
|
|
239
|
+
render(): void;
|
|
240
|
+
render(component: string, args: any[]): void;
|
|
241
|
+
createComponents(...args: string[]): HTMLElement[];
|
|
242
|
+
setOpts(config: Config): void;
|
|
243
|
+
setSrc(sources: UnsafeSource): Player;
|
|
244
|
+
on<T>(event: string | string[], handler: (e: FPEvent<T>) => void): Player;
|
|
245
|
+
once<T>(event: string, handler: (e: FPEvent<T>) => void): Player;
|
|
246
|
+
off<T>(event: string, handler: (e: FPEvent<T>) => void): Player;
|
|
247
|
+
poll<T>(event: string, data?: T): FPEvent<T>;
|
|
248
|
+
emit<T>(event: string, data?: T): Player;
|
|
249
|
+
setAttrs(attrs: Config): Player;
|
|
250
|
+
opt<T>(key: string, fallback?: T): T;
|
|
251
|
+
enqueueSeek(offset: number): any;
|
|
252
|
+
setState(state: string, flag: boolean): Player;
|
|
253
|
+
toJSON(): JSONPlayer;
|
|
254
|
+
i18n(k: string, fallback?: string): string;
|
|
255
|
+
deviceId(): DeviceId;
|
|
256
|
+
live_state: {
|
|
257
|
+
dvr?: boolean;
|
|
258
|
+
dvr_window?: number;
|
|
259
|
+
};
|
|
260
|
+
opts: Config;
|
|
261
|
+
plugins: Array<Plugin_2 | Loader>;
|
|
262
|
+
dvr_offset?: number;
|
|
263
|
+
message?: {
|
|
264
|
+
events: Record<string, string>;
|
|
265
|
+
};
|
|
266
|
+
disabled: boolean;
|
|
267
|
+
started?: boolean;
|
|
268
|
+
token: string;
|
|
269
|
+
tracks?: VideoTrack[];
|
|
270
|
+
_customElements: FlowplayerCustomElementRegistry;
|
|
271
|
+
_storage: Storage;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
declare type PlayerRoot = HTMLElement & {
|
|
275
|
+
prevWidth?: number;
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
declare namespace Players {
|
|
279
|
+
export {
|
|
280
|
+
VideoTrack,
|
|
281
|
+
PlayerState,
|
|
282
|
+
FPEvent,
|
|
283
|
+
DeviceId,
|
|
284
|
+
JSONPlayer,
|
|
285
|
+
PlayerRoot,
|
|
286
|
+
Player
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
declare type PlayerState = string;
|
|
291
|
+
|
|
292
|
+
declare type PlayerWith<T> = Players.Player & T;
|
|
293
|
+
|
|
294
|
+
declare type PlayerWithMessage = PlayerWith<{
|
|
295
|
+
message?: string;
|
|
296
|
+
}>;
|
|
297
|
+
|
|
298
|
+
declare interface Plugin_2<PluginOwnConfig extends KeyValue = KeyValue> {
|
|
299
|
+
/**
|
|
300
|
+
* a plugin must always implement the init method so a player instance knows how to initialize it
|
|
301
|
+
*/
|
|
302
|
+
init<T>(config: PluginConfig<T>, container: PlayerRoot, player: Player): void;
|
|
303
|
+
init(config: PluginConfig<PluginOwnConfig>, container: PlayerRoot, player: Player): void;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
declare type PluginConfig<T> = Config & T;
|
|
307
|
+
|
|
308
|
+
declare interface PluginCtor<PluginOwnConfig extends KeyValue = KeyValue> {
|
|
309
|
+
new (umd: FlowplayerUMD, player: Player): AnyPlugin<PluginOwnConfig>;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
declare class Share implements Plugin_2 {
|
|
313
|
+
private umd;
|
|
314
|
+
static events: {
|
|
315
|
+
OPTIONS: string;
|
|
316
|
+
};
|
|
317
|
+
private share_options;
|
|
318
|
+
constructor(umd: FlowplayerUMD);
|
|
319
|
+
init(config: Config, container: PlayerRoot, player: PlayerWithMessage): void;
|
|
320
|
+
add_options(player: Player, ...options: MenuOption[]): void;
|
|
321
|
+
}
|
|
322
|
+
export default Share;
|
|
323
|
+
|
|
324
|
+
declare type SourceList = Array<SourceObj>;
|
|
325
|
+
|
|
326
|
+
declare type SourceObj = {
|
|
327
|
+
src?: SourceStr;
|
|
328
|
+
type?: string;
|
|
329
|
+
drm?: DRMSourceConfiguration;
|
|
330
|
+
};
|
|
331
|
+
|
|
332
|
+
declare namespace Sources {
|
|
333
|
+
export {
|
|
334
|
+
SourceStr,
|
|
335
|
+
DRM_KEYSYSTEM,
|
|
336
|
+
SourceObj,
|
|
337
|
+
DRMSourceConfiguration,
|
|
338
|
+
SourceWith,
|
|
339
|
+
UnsafeSource,
|
|
340
|
+
SourceList,
|
|
341
|
+
DRMConfiguration,
|
|
342
|
+
DRMVendorImplementation
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
declare type SourceStr = string;
|
|
347
|
+
|
|
348
|
+
declare type SourceWith<T> = SourceObj & T;
|
|
349
|
+
|
|
350
|
+
/* Excluded from this release type: State */
|
|
351
|
+
|
|
352
|
+
declare type UnsafeSource = SourceStr | SourceObj | Array<SourceStr | SourceObj>;
|
|
353
|
+
|
|
354
|
+
declare interface VideoTrack {
|
|
355
|
+
name: string;
|
|
356
|
+
data: any;
|
|
357
|
+
default: boolean;
|
|
358
|
+
selected: boolean;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
export { }
|