@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.
Files changed (49) hide show
  1. package/core.js +1 -1
  2. package/default.js +1 -1
  3. package/embed.js +2 -2
  4. package/index.d.ts +0 -3
  5. package/package.json +39 -1
  6. package/plugins/ads.d.ts +775 -0
  7. package/plugins/ads.js +1 -1
  8. package/plugins/airplay.d.ts +377 -0
  9. package/plugins/analytics.d.ts +242 -0
  10. package/plugins/analytics.js +1 -1
  11. package/plugins/asel.d.ts +360 -0
  12. package/plugins/audio.d.ts +347 -0
  13. package/plugins/chapters.d.ts +391 -0
  14. package/plugins/chromecast.d.ts +422 -0
  15. package/plugins/consent.d.ts +373 -0
  16. package/plugins/context-menu.d.ts +212 -0
  17. package/plugins/cuepoints.d.ts +0 -3
  18. package/plugins/dash.d.ts +235 -0
  19. package/plugins/drm.d.ts +248 -0
  20. package/plugins/endscreen.d.ts +407 -0
  21. package/plugins/fas.d.ts +364 -0
  22. package/plugins/float-on-scroll.d.ts +367 -0
  23. package/plugins/ga4.d.ts +454 -0
  24. package/plugins/gemius.d.ts +385 -0
  25. package/plugins/google-analytics.d.ts +456 -0
  26. package/plugins/health.d.ts +385 -0
  27. package/plugins/health.js +1 -1
  28. package/plugins/hls.d.ts +229 -0
  29. package/plugins/id3.d.ts +198 -0
  30. package/plugins/iframe.d.ts +356 -0
  31. package/plugins/keyboard.d.ts +189 -0
  32. package/plugins/media-session.d.ts +189 -0
  33. package/plugins/message.d.ts +193 -0
  34. package/plugins/ovp.d.ts +411 -0
  35. package/plugins/playlist.d.ts +394 -0
  36. package/plugins/preview.d.ts +243 -0
  37. package/plugins/qsel.d.ts +352 -0
  38. package/plugins/qul.d.ts +220 -0
  39. package/plugins/rts.d.ts +273 -0
  40. package/plugins/share.d.ts +361 -0
  41. package/plugins/speed.d.ts +346 -0
  42. package/plugins/ssai.d.ts +412 -0
  43. package/plugins/ssai.js +1 -1
  44. package/plugins/subtitles.d.ts +362 -0
  45. package/plugins/thumbnails.d.ts +375 -0
  46. package/plugins/tizen.d.ts +430 -0
  47. package/plugins/vtsel.d.ts +348 -0
  48. package/plugins/webos.d.ts +430 -0
  49. package/util/loader.d.ts +0 -3
@@ -0,0 +1,348 @@
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 MergeConfigs<Arr extends PluginCtor[]> = ArrayToIntersection<MapToConfigs<Arr>>;
218
+
219
+ declare interface Player extends HTMLVideoElement {
220
+ renderPlugin: (pluginContainer: HTMLElement) => void;
221
+ toggleDisable: (flag: boolean) => void;
222
+ original_src: string;
223
+ root: PlayerRoot;
224
+ playerState: Record<string, boolean>;
225
+ reaper: Map<string, any> | 0;
226
+ hasState(state: PlayerState): boolean;
227
+ transitionState(to: PlayerState, from: PlayerState, timer?: number): void;
228
+ togglePlay(on?: boolean): Promise<void>;
229
+ toggleFullScreen(on?: boolean, state_only?: boolean): void;
230
+ toggleMute(on?: boolean): void;
231
+ destroy(): void;
232
+ render(): void;
233
+ render(component: string, args: any[]): void;
234
+ createComponents(...args: string[]): HTMLElement[];
235
+ setOpts(config: Config): void;
236
+ setSrc(sources: UnsafeSource): Player;
237
+ on<T>(event: string | string[], handler: (e: FPEvent<T>) => void): Player;
238
+ once<T>(event: string, handler: (e: FPEvent<T>) => void): Player;
239
+ off<T>(event: string, handler: (e: FPEvent<T>) => void): Player;
240
+ poll<T>(event: string, data?: T): FPEvent<T>;
241
+ emit<T>(event: string, data?: T): Player;
242
+ setAttrs(attrs: Config): Player;
243
+ opt<T>(key: string, fallback?: T): T;
244
+ enqueueSeek(offset: number): any;
245
+ setState(state: string, flag: boolean): Player;
246
+ toJSON(): JSONPlayer;
247
+ i18n(k: string, fallback?: string): string;
248
+ deviceId(): DeviceId;
249
+ live_state: {
250
+ dvr?: boolean;
251
+ dvr_window?: number;
252
+ };
253
+ opts: Config;
254
+ plugins: Array<Plugin_2 | Loader>;
255
+ dvr_offset?: number;
256
+ message?: {
257
+ events: Record<string, string>;
258
+ };
259
+ disabled: boolean;
260
+ started?: boolean;
261
+ token: string;
262
+ tracks?: VideoTrack[];
263
+ _customElements: FlowplayerCustomElementRegistry;
264
+ _storage: Storage;
265
+ }
266
+
267
+ declare type PlayerRoot = HTMLElement & {
268
+ prevWidth?: number;
269
+ };
270
+
271
+ declare namespace Players {
272
+ export {
273
+ VideoTrack,
274
+ PlayerState,
275
+ FPEvent,
276
+ DeviceId,
277
+ JSONPlayer,
278
+ PlayerRoot,
279
+ Player
280
+ }
281
+ }
282
+
283
+ declare type PlayerState = string;
284
+
285
+ declare type PlayerWith<T> = Players.Player & T;
286
+
287
+ declare interface Plugin_2<PluginOwnConfig extends KeyValue = KeyValue> {
288
+ /**
289
+ * a plugin must always implement the init method so a player instance knows how to initialize it
290
+ */
291
+ init<T>(config: PluginConfig<T>, container: PlayerRoot, player: Player): void;
292
+ init(config: PluginConfig<PluginOwnConfig>, container: PlayerRoot, player: Player): void;
293
+ }
294
+
295
+ declare type PluginConfig<T> = Config & T;
296
+
297
+ declare interface PluginCtor<PluginOwnConfig extends KeyValue = KeyValue> {
298
+ new (umd: FlowplayerUMD, player: Player): AnyPlugin<PluginOwnConfig>;
299
+ }
300
+
301
+ declare type SourceList = Array<SourceObj>;
302
+
303
+ declare type SourceObj = {
304
+ src?: SourceStr;
305
+ type?: string;
306
+ drm?: DRMSourceConfiguration;
307
+ };
308
+
309
+ declare namespace Sources {
310
+ export {
311
+ SourceStr,
312
+ DRM_KEYSYSTEM,
313
+ SourceObj,
314
+ DRMSourceConfiguration,
315
+ SourceWith,
316
+ UnsafeSource,
317
+ SourceList,
318
+ DRMConfiguration,
319
+ DRMVendorImplementation
320
+ }
321
+ }
322
+
323
+ declare type SourceStr = string;
324
+
325
+ declare type SourceWith<T> = SourceObj & T;
326
+
327
+ declare type UnsafeSource = SourceStr | SourceObj | Array<SourceStr | SourceObj>;
328
+
329
+ declare interface VideoTrack {
330
+ name: string;
331
+ data: any;
332
+ default: boolean;
333
+ selected: boolean;
334
+ }
335
+
336
+ declare class Vtsel implements Plugin_2 {
337
+ static events: {
338
+ TRACKS: string;
339
+ SWITCH: string;
340
+ };
341
+ constructor(umd: FlowplayerUMD);
342
+ init(_: Config, root: PlayerRoot, player: PlayerWith<{
343
+ videoTracks?: any;
344
+ }>): void;
345
+ }
346
+ export default Vtsel;
347
+
348
+ export { }