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