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