tiny-essentials 1.28.3 → 1.28.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.
Files changed (52) hide show
  1. package/changelog/1/28/4.md +4 -0
  2. package/changelog/1/28/5.md +31 -0
  3. package/dist/v1/TinyBasicsEs.min.js +1 -1
  4. package/dist/v1/TinyEssentials.min.js +1 -1
  5. package/dist/v1/TinyMediaPlayer.min.js +1 -1
  6. package/dist/v1/TinyTimeout.min.js +1 -1
  7. package/dist/v1/TinyUploadClicker.min.js +1 -1
  8. package/dist/v1/basics/index.cjs +4 -0
  9. package/dist/v1/basics/index.d.mts +3 -2
  10. package/dist/v1/basics/index.mjs +3 -2
  11. package/dist/v1/basics/mediaContent.cjs +1 -0
  12. package/dist/v1/basics/mediaContent.d.mts +4 -0
  13. package/dist/v1/basics/mediaContent.mjs +1 -0
  14. package/dist/v1/basics/objChecker.cjs +16 -0
  15. package/dist/v1/basics/objChecker.d.mts +12 -0
  16. package/dist/v1/basics/objChecker.mjs +14 -0
  17. package/dist/v1/basics/objFilter.cjs +21 -30
  18. package/dist/v1/basics/objFilter.d.mts +0 -2
  19. package/dist/v1/basics/objFilter.mjs +21 -30
  20. package/dist/v1/basics/promiseUtils.cjs +101 -0
  21. package/dist/v1/basics/promiseUtils.d.mts +31 -0
  22. package/dist/v1/basics/promiseUtils.mjs +89 -0
  23. package/dist/v1/index.cjs +4 -0
  24. package/dist/v1/index.d.mts +3 -2
  25. package/dist/v1/index.mjs +3 -2
  26. package/dist/v1/libs/TinyMediaPlayer/HtmlAudio.cjs +268 -0
  27. package/dist/v1/libs/TinyMediaPlayer/HtmlAudio.d.mts +118 -0
  28. package/dist/v1/libs/TinyMediaPlayer/HtmlAudio.mjs +237 -0
  29. package/dist/v1/libs/TinyMediaPlayer/HtmlVideo.cjs +265 -0
  30. package/dist/v1/libs/TinyMediaPlayer/HtmlVideo.d.mts +118 -0
  31. package/dist/v1/libs/TinyMediaPlayer/HtmlVideo.mjs +234 -0
  32. package/dist/v1/libs/TinyMediaPlayer/Youtube.cjs +671 -0
  33. package/dist/v1/libs/TinyMediaPlayer/Youtube.d.mts +259 -0
  34. package/dist/v1/libs/TinyMediaPlayer/Youtube.mjs +597 -0
  35. package/dist/v1/libs/TinyMediaPlayer/docs/YouTubePlayer.cjs +546 -0
  36. package/dist/v1/libs/TinyMediaPlayer/docs/YouTubePlayer.d.mts +657 -0
  37. package/dist/v1/libs/TinyMediaPlayer/docs/YouTubePlayer.mjs +480 -0
  38. package/dist/v1/libs/TinyMediaPlayer/index.cjs +165 -0
  39. package/dist/v1/libs/TinyMediaPlayer/index.d.mts +102 -0
  40. package/dist/v1/libs/TinyMediaPlayer/index.mjs +144 -0
  41. package/dist/v1/libs/TinyMediaPlayer.cjs +589 -103
  42. package/dist/v1/libs/TinyMediaPlayer.d.mts +150 -65
  43. package/dist/v1/libs/TinyMediaPlayer.mjs +535 -93
  44. package/dist/v1/libs/TinyTimeout.cjs +4 -14
  45. package/dist/v1/libs/TinyTimeout.d.mts +1 -0
  46. package/dist/v1/libs/TinyTimeout.mjs +4 -13
  47. package/docs/v1/basics/mediaContent.md +1 -1
  48. package/docs/v1/basics/objChecker.md +13 -0
  49. package/docs/v1/basics/promiseUtils.md +32 -0
  50. package/docs/v1/libs/TinyMediaPlayer.md +239 -32
  51. package/docs/v1/libs/TinyTimeout.md +1 -14
  52. package/package.json +21 -1
@@ -0,0 +1,657 @@
1
+ /**
2
+ * https://developers.google.com/youtube/iframe_api_reference
3
+ * @fileoverview JSDoc type definitions for the YouTube IFrame Player API.
4
+ * This file provides full IntelliSense/autocomplete for the global `window.YT` object.
5
+ * @module youtube-api-docs
6
+ */
7
+ export type YTPlayerState = -1 | 0 | 1 | 2 | 3 | 5;
8
+ export type YTPlayerErrors = 2 | 5 | 100 | 101 | 150;
9
+ export type YTQuality = 'small' | 'medium' | 'large' | 'hd720' | 'hd1080' | 'highres';
10
+ export type YTSphericalProperties = {
11
+ /**
12
+ * - Horizontal angle of view [0, 360].
13
+ */
14
+ yaw: number;
15
+ /**
16
+ * - Vertical angle of view [-90, 90].
17
+ */
18
+ pitch: number;
19
+ /**
20
+ * - Rotational angle [-180, 180].
21
+ */
22
+ roll: number;
23
+ /**
24
+ * - Field of view [30, 120].
25
+ */
26
+ fov: number;
27
+ };
28
+ export type YouTubePlayerEventBase = {
29
+ /**
30
+ * - The player object that emitted the event.
31
+ */
32
+ target: YouTubePlayer;
33
+ };
34
+ export type OnReadyEvent = (event: YouTubePlayerEventBase) => void;
35
+ export type OnStateChangeEvent = (event: YouTubePlayerEventBase & {
36
+ data: YTPlayerState;
37
+ }) => void;
38
+ export type OnErrorEvent = (event: YouTubePlayerEventBase & {
39
+ data: YTPlayerErrors;
40
+ }) => void;
41
+ export type OnPlaybackQualityChangeEvent = (event: YouTubePlayerEventBase & {
42
+ data: YTQuality;
43
+ }) => void;
44
+ export type OnPlaybackRateChangeEvent = (event: YouTubePlayerEventBase & {
45
+ data: number;
46
+ }) => void;
47
+ export type OnApiChangeEvent = (event: YouTubePlayerEventBase & {
48
+ data: any;
49
+ }) => void;
50
+ export type OnAutoplayBlockedEvent = (event: YouTubePlayerEventBase) => void;
51
+ export type YTPlayerOptionsEvents = {
52
+ /**
53
+ * - Called when the player is ready.
54
+ */
55
+ onReady?: OnReadyEvent;
56
+ /**
57
+ * - Called when the state changes.
58
+ */
59
+ onStateChange?: OnStateChangeEvent;
60
+ /**
61
+ * - Called when an error occurs.
62
+ */
63
+ onError?: OnErrorEvent;
64
+ /**
65
+ * - Called when quality changes.
66
+ */
67
+ onPlaybackQualityChange?: OnPlaybackQualityChangeEvent;
68
+ /**
69
+ * - Called when playback rate changes.
70
+ */
71
+ onPlaybackRateChange?: OnPlaybackRateChangeEvent;
72
+ /**
73
+ * - Called when the API module changes.
74
+ */
75
+ onApiChange?: OnApiChangeEvent;
76
+ /**
77
+ * - Called when autoplay is blocked.
78
+ */
79
+ onAutoplayBlocked?: OnAutoplayBlockedEvent;
80
+ };
81
+ export type YTPlayerOptions = {
82
+ /**
83
+ * - Desired width of the player frame in pixels.
84
+ */
85
+ width?: number | string;
86
+ /**
87
+ * - Desired height of the player frame in pixels.
88
+ */
89
+ height?: number | string;
90
+ /**
91
+ * - The unique identifier for the YouTube video to load.
92
+ */
93
+ videoId?: string;
94
+ /**
95
+ * - Additional configuration parameters passed to the player.
96
+ */
97
+ playerVars?: Record<string, any>;
98
+ /**
99
+ * - An object containing event listeners to handle specific player events.
100
+ */
101
+ events?: YTPlayerOptionsEvents;
102
+ };
103
+ export type EventNames = 'onReady' | 'onStateChange' | 'onError' | 'onPlaybackQualityChange' | 'onPlaybackRateChange' | 'onApiChange' | 'onAutoplayBlocked';
104
+ export type YTPlaylistOptions = {
105
+ /**
106
+ * - Specifies whether to use a standard playlist or user uploads feed.
107
+ */
108
+ listType?: 'playlist' | 'user_uploads';
109
+ /**
110
+ * - The ID of the target playlist or an array containing multiple video IDs.
111
+ */
112
+ list: string | string[];
113
+ /**
114
+ * - The zero-based index of the first video that should be played from the list.
115
+ */
116
+ index?: number;
117
+ /**
118
+ * - The specific time in seconds where the playback of the first video should begin.
119
+ */
120
+ startSeconds?: number;
121
+ };
122
+ export type VideoByUrlOptions = {
123
+ /**
124
+ * - The complete URL pointing to the desired YouTube video resource.
125
+ */
126
+ mediaContentUrl: string;
127
+ /**
128
+ * - Optional time in seconds to begin playback from within the video.
129
+ */
130
+ startSeconds?: number;
131
+ /**
132
+ * - Optional time in seconds when playback should stop within the video.
133
+ */
134
+ endSeconds?: number;
135
+ };
136
+ export type VideoByIdOptions = {
137
+ /**
138
+ * - The unique identifier of the target YouTube video.
139
+ */
140
+ videoId: string;
141
+ /**
142
+ * - Optional time in seconds to begin playback from within the video.
143
+ */
144
+ startSeconds?: number;
145
+ /**
146
+ * - Optional time in seconds when playback should stop within the video.
147
+ */
148
+ endSeconds?: number;
149
+ };
150
+ export type VideoData = {
151
+ /**
152
+ * - Whether DVR capabilities are permitted for live content.
153
+ */
154
+ allowLiveDvr: boolean | null;
155
+ /**
156
+ * - The name or ID of the video creator.
157
+ */
158
+ author: string | null;
159
+ /**
160
+ * - Indicates if the video can be played in the background while minimized.
161
+ */
162
+ backgroundable: boolean | null;
163
+ /**
164
+ * - Content Protection Network identifier.
165
+ */
166
+ cpn: string | null;
167
+ /**
168
+ * - A specific error code if playback failed.
169
+ */
170
+ errorCode: number | null;
171
+ /**
172
+ * - An ID related to a specific content event.
173
+ */
174
+ eventId: string | null;
175
+ /**
176
+ * - Flag indicating if the progress bar has defined start/end boundaries.
177
+ */
178
+ hasProgressBarBoundaries: boolean | null;
179
+ /**
180
+ * - Indicates if the video belongs to a list or series.
181
+ */
182
+ isListed: boolean | null;
183
+ /**
184
+ * - True if the content is currently streaming live.
185
+ */
186
+ isLive: boolean | null;
187
+ /**
188
+ * - Flag indicating if manifest files are not being used for streaming.
189
+ */
190
+ isManifestless: boolean | null;
191
+ /**
192
+ * - Indicates support for multiple audio channels.
193
+ */
194
+ isMultiChannelAudio: boolean | null;
195
+ /**
196
+ * - Overall flag indicating the video can be played by the player.
197
+ */
198
+ isPlayable: boolean | null;
199
+ /**
200
+ * - True if the content is a scheduled premiere.
201
+ */
202
+ isPremiere: boolean | null;
203
+ /**
204
+ * - Whether random access seeking within the video is allowed.
205
+ */
206
+ isSeekable: boolean | null;
207
+ /**
208
+ * - Indicates if it is a windowed live event.
209
+ */
210
+ isWindowedLive: boolean | null;
211
+ /**
212
+ * - Indicator of Interactivity Content Tracking tag.
213
+ */
214
+ itct: string | null;
215
+ /**
216
+ * - Duration in milliseconds for paid content overlays.
217
+ */
218
+ paidContentOverlayDurationMs: number | null;
219
+ /**
220
+ * - Content Protection Network response identifier from the player itself.
221
+ */
222
+ playerResponseCpn: string | null;
223
+ /**
224
+ * - UTC time in milliseconds for the end of the video's progress bar.
225
+ */
226
+ progressBarEndPositionUtcTimeMillis: number | null;
227
+ /**
228
+ * - UTC time in milliseconds for the start of the video's progress bar.
229
+ */
230
+ progressBarStartPositionUtcTimeMillis: number | null;
231
+ /**
232
+ * - The descriptive title of the video.
233
+ */
234
+ title: string | null;
235
+ /**
236
+ * - The unique ID string of the video content.
237
+ */
238
+ video_id: string | null;
239
+ };
240
+ /**
241
+ * Represents the current state of the player.
242
+ * @typedef {-1|0|1|2|3|5} YTPlayerState
243
+ * @property {-1} UNSTARTED - The video has not been started.
244
+ * @property {0} ENDED - The video has ended.
245
+ * @property {1} PLAYING - The video is playing.
246
+ * @property {2} PAUSED - The video is paused.
247
+ * @property {3} BUFFERING - The video is buffering.
248
+ * @property {5} CUED - The video is cued and ready to play.
249
+ */
250
+ /**
251
+ * Represents the player error codes.
252
+ * @typedef {2|5|100|101|150} YTPlayerErrors
253
+ * @property {2} INVALIDPARAM - The request contains an invalid parameter value (e.g., invalid video ID).
254
+ * @property {5} INVALIDPLAYER - The content cannot be played in an HTML5 player or an HTML5 error occurred.
255
+ * @property {100} NOTFOUND - The requested video was not found (removed or private).
256
+ * @property {101} NOTALLOWED - The owner does not allow playback in embedded players.
257
+ * @property {150} NOTALLOWED_REDUNDANT - Same as 101.
258
+ */
259
+ /**
260
+ * The playback quality string.
261
+ * @typedef {'small'|'medium'|'large'|'hd720'|'hd1080'|'highres'} YTQuality
262
+ */
263
+ /**
264
+ * Properties for 360° video playback, defining the viewing angle.
265
+ * @typedef {Object} YTSphericalProperties
266
+ * @property {number} yaw - Horizontal angle of view [0, 360].
267
+ * @property {number} pitch - Vertical angle of view [-90, 90].
268
+ * @property {number} roll - Rotational angle [-180, 180].
269
+ * @property {number} fov - Field of view [30, 120].
270
+ */
271
+ /**
272
+ * Base structure for all YouTube Player Events.
273
+ * @typedef {Object} YouTubePlayerEventBase
274
+ * @property {YouTubePlayer} target - The player object that emitted the event.
275
+ */
276
+ /**
277
+ * Called when the player is ready to accept commands.
278
+ * @typedef {(event: YouTubePlayerEventBase) => void} OnReadyEvent
279
+ */
280
+ /**
281
+ * Called when the video playback state changes (e.g., playing, paused).
282
+ * @typedef {(event: YouTubePlayerEventBase & { data: YTPlayerState }) => void} OnStateChangeEvent
283
+ */
284
+ /**
285
+ * Called when an error occurs during video processing or playback.
286
+ * @typedef {(event: YouTubePlayerEventBase & { data: YTPlayerErrors }) => void} OnErrorEvent
287
+ */
288
+ /**
289
+ * Called specifically when the playback quality setting is updated.
290
+ * @typedef {(event: YouTubePlayerEventBase & { data: YTQuality }) => void} OnPlaybackQualityChangeEvent
291
+ */
292
+ /**
293
+ * Called when the video's speed (playback rate) changes or is set.
294
+ * @typedef {(event: YouTubePlayerEventBase & { data: number }) => void} OnPlaybackRateChangeEvent
295
+ */
296
+ /**
297
+ * Called when a change occurs within the API module itself.
298
+ * @typedef {(event: YouTubePlayerEventBase & { data: any }) => void} OnApiChangeEvent
299
+ */
300
+ /**
301
+ * Called when automatic playback is specifically blocked by the browser or platform rules.
302
+ * @typedef {(event: YouTubePlayerEventBase) => void} OnAutoplayBlockedEvent
303
+ */
304
+ /**
305
+ * Container object for configuring event listeners on the player instance.
306
+ * @typedef {Object} YTPlayerOptionsEvents
307
+ * @property {OnReadyEvent} [onReady] - Called when the player is ready.
308
+ * @property {OnStateChangeEvent} [onStateChange] - Called when the state changes.
309
+ * @property {OnErrorEvent} [onError] - Called when an error occurs.
310
+ * @property {OnPlaybackQualityChangeEvent} [onPlaybackQualityChange] - Called when quality changes.
311
+ * @property {OnPlaybackRateChangeEvent} [onPlaybackRateChange] - Called when playback rate changes.
312
+ * @property {OnApiChangeEvent} [onApiChange] - Called when the API module changes.
313
+ * @property {OnAutoplayBlockedEvent} [onAutoplayBlocked] - Called when autoplay is blocked.
314
+ */
315
+ /**
316
+ * Configuration options for initializing the YouTube Player instance.
317
+ * @typedef {Object} YTPlayerOptions
318
+ * @property {number|string} [width=640] - Desired width of the player frame in pixels.
319
+ * @property {number|string} [height=390] - Desired height of the player frame in pixels.
320
+ * @property {string} [videoId] - The unique identifier for the YouTube video to load.
321
+ * @property {Object<string, any>} [playerVars] - Additional configuration parameters passed to the player.
322
+ * @property {YTPlayerOptionsEvents} [events] - An object containing event listeners to handle specific player events.
323
+ */
324
+ /**
325
+ * List of valid names for all YouTube Player Event listeners.
326
+ * @typedef {'onReady'|'onStateChange'|'onError'|'onPlaybackQualityChange'|'onPlaybackRateChange'|'onApiChange'|'onAutoplayBlocked'} EventNames
327
+ */
328
+ /**
329
+ * Options specifically used when queuing or loading a playlist.
330
+ * @typedef {Object} YTPlaylistOptions
331
+ * @property {'playlist'|'user_uploads'} [listType='playlist'] - Specifies whether to use a standard playlist or user uploads feed.
332
+ * @property {string|string[]} list - The ID of the target playlist or an array containing multiple video IDs.
333
+ * @property {number} [index=0] - The zero-based index of the first video that should be played from the list.
334
+ * @property {number} [startSeconds] - The specific time in seconds where the playback of the first video should begin.
335
+ */
336
+ /**
337
+ * Options used to cue or load a video based on its full media URL.
338
+ * @typedef {Object} VideoByUrlOptions
339
+ * @property {string} mediaContentUrl - The complete URL pointing to the desired YouTube video resource.
340
+ * @property {number} [startSeconds] - Optional time in seconds to begin playback from within the video.
341
+ * @property {number} [endSeconds] - Optional time in seconds when playback should stop within the video.
342
+ */
343
+ /**
344
+ * Options used to cue or load a video based on its unique ID.
345
+ * @typedef {Object} VideoByIdOptions
346
+ * @property {string} videoId - The unique identifier of the target YouTube video.
347
+ * @property {number} [startSeconds] - Optional time in seconds to begin playback from within the video.
348
+ * @property {number} [endSeconds] - Optional time in seconds when playback should stop within the video.
349
+ */
350
+ /**
351
+ * Detailed data object representing the current status and metadata of a loaded YouTube video.
352
+ * @typedef {Object} VideoData
353
+ * @property {boolean|null} allowLiveDvr - Whether DVR capabilities are permitted for live content.
354
+ * @property {string|null} author - The name or ID of the video creator.
355
+ * @property {boolean|null} backgroundable - Indicates if the video can be played in the background while minimized.
356
+ * @property {string|null} cpn - Content Protection Network identifier.
357
+ * @property {number|null} errorCode - A specific error code if playback failed.
358
+ * @property {string|null} eventId - An ID related to a specific content event.
359
+ * @property {boolean|null} hasProgressBarBoundaries - Flag indicating if the progress bar has defined start/end boundaries.
360
+ * @property {boolean|null} isListed - Indicates if the video belongs to a list or series.
361
+ * @property {boolean|null} isLive - True if the content is currently streaming live.
362
+ * @property {boolean|null} isManifestless - Flag indicating if manifest files are not being used for streaming.
363
+ * @property {boolean|null} isMultiChannelAudio - Indicates support for multiple audio channels.
364
+ * @property {boolean|null} isPlayable - Overall flag indicating the video can be played by the player.
365
+ * @property {boolean|null} isPremiere - True if the content is a scheduled premiere.
366
+ * @property {boolean|null} isSeekable - Whether random access seeking within the video is allowed.
367
+ * @property {boolean|null} isWindowedLive - Indicates if it is a windowed live event.
368
+ * @property {string|null} itct - Indicator of Interactivity Content Tracking tag.
369
+ * @property {number|null} paidContentOverlayDurationMs - Duration in milliseconds for paid content overlays.
370
+ * @property {string|null} playerResponseCpn - Content Protection Network response identifier from the player itself.
371
+ * @property {number|null} progressBarEndPositionUtcTimeMillis - UTC time in milliseconds for the end of the video's progress bar.
372
+ * @property {number|null} progressBarStartPositionUtcTimeMillis - UTC time in milliseconds for the start of the video's progress bar.
373
+ * @property {string|null} title - The descriptive title of the video.
374
+ * @property {string|null} video_id - The unique ID string of the video content.
375
+ */
376
+ /**
377
+ * The main YouTube Player class instance. Manages all player interactions and state.
378
+ */
379
+ declare class YouTubePlayer {
380
+ /**
381
+ * Constructor for the YouTube Player. Initializes the player element.
382
+ * @param {string|HTMLElement} element - The DOM element or its ID where the player iframe will be inserted.
383
+ * @param {YTPlayerOptions} [options] - Optional configuration settings for the player initialization.
384
+ */
385
+ constructor(element: string | HTMLElement, options?: YTPlayerOptions);
386
+ /**
387
+ * Stores and retrieves the title of the currently loaded video.
388
+ * @type {string|null|undefined}
389
+ */
390
+ videoTitle: string | null | undefined;
391
+ /**
392
+ * Retrieves a comprehensive snapshot of the current video metadata and status (e.g., ID, author, playability).
393
+ * @returns {Partial<VideoData>} A partial object containing various details about the loaded content.
394
+ */
395
+ getVideoData(): Partial<VideoData>;
396
+ /**
397
+ * Plays the loaded/selected video.
398
+ *
399
+ * The final player state after this function executes will be playing (1).
400
+ * @returns {void}
401
+ */
402
+ playVideo(): void;
403
+ /**
404
+ * Pauses the playing video.
405
+ *
406
+ * The final player state after this function executes will be paused (2)
407
+ * unless the player is in the ended (0) state when the function is called,
408
+ * in which case the player state will not change.
409
+ * @returns {void}
410
+ */
411
+ pauseVideo(): void;
412
+ /**
413
+ * Stops and cancels the current video playback.
414
+ *
415
+ * Important: Unlike the pauseVideo function, which leaves the player in the
416
+ * paused (2) state, the stopVideo function could put the player into any
417
+ * not-playing state, including ended (0), paused (2), video cued (5) or
418
+ * unstarted (-1).
419
+ * @returns {void}
420
+ */
421
+ stopVideo(): void;
422
+ /**
423
+ * Seeks to a specific time in the video.
424
+ * @param {number} seconds - The time to seek to.
425
+ * @param {boolean} [allowSeekAhead] - Whether to make a new request to the server if the time is outside the buffer.
426
+ * @returns {void}
427
+ */
428
+ seekTo(seconds: number, allowSeekAhead?: boolean): void;
429
+ /**
430
+ * Retrieves the current spherical properties for 360° video playback.
431
+ * @returns {YTSphericalProperties}
432
+ */
433
+ getSphericalProperties(): YTSphericalProperties;
434
+ /**
435
+ * Sets the orientation for 360° video playback.
436
+ * @param {YTSphericalProperties & { enableOrientationSensor?: boolean }} properties - The new orientation properties.
437
+ * @returns {void}
438
+ */
439
+ setSphericalProperties(properties: YTSphericalProperties & {
440
+ enableOrientationSensor?: boolean;
441
+ }): void;
442
+ /**
443
+ * Loads and plays the next video in the playlist.
444
+ * @returns {void}
445
+ */
446
+ nextVideo(): void;
447
+ /**
448
+ * Loads and plays the previous video in the playlist.
449
+ * @returns {void}
450
+ */
451
+ previousVideo(): void;
452
+ /**
453
+ * Loads and plays the video at the specified index in the playlist.
454
+ * @param {number} index - The zero-based index of the video.
455
+ * @returns {void}
456
+ */
457
+ playVideoAt(index: number): void;
458
+ /**
459
+ * Mutes the player.
460
+ * @returns {void}
461
+ */
462
+ mute(): void;
463
+ /**
464
+ * Unmutes the player.
465
+ * @returns {void}
466
+ */
467
+ unMute(): void;
468
+ /**
469
+ * Checks if the player is muted.
470
+ * @returns {boolean}
471
+ */
472
+ isMuted(): boolean;
473
+ /**
474
+ * Sets the player volume.
475
+ * @param {number} volume - Volume level between 0 and 100.
476
+ * @returns {void}
477
+ */
478
+ setVolume(volume: number): void;
479
+ /**
480
+ * Gets the current player volume between 0 and 100.
481
+ * @returns {number}
482
+ */
483
+ getVolume(): number;
484
+ /**
485
+ * Sets the size of the <iframe>.
486
+ * @param {number|string} width - Width in pixels.
487
+ * @param {number|string} height - Height in pixels.
488
+ * @returns {this}
489
+ */
490
+ setSize(width: number | string, height: number | string): this;
491
+ /**
492
+ * Gets the current playback rate.
493
+ * @returns {number}
494
+ */
495
+ getPlaybackRate(): number;
496
+ /**
497
+ * Sets the suggested playback rate.
498
+ * @param {number} suggestedRate - The playback rate (e.g., 0.5, 1, 1.5, 2).
499
+ * @returns {void}
500
+ */
501
+ setPlaybackRate(suggestedRate: number): void;
502
+ /**
503
+ * Gets the available playback rates for the current video.
504
+ * @returns {number[]}
505
+ */
506
+ getAvailablePlaybackRates(): number[];
507
+ /**
508
+ * Sets whether the playlist should loop.
509
+ * @param {boolean} loopPlaylists - If true, the playlist repeats after the last video.
510
+ * @returns {void}
511
+ */
512
+ setLoop(loopPlaylists: boolean): void;
513
+ /**
514
+ * Sets whether the playlist should be shuffled.
515
+ * @param {boolean} shufflePlaylist - If true, the playlist order is randomized.
516
+ * @returns {void}
517
+ */
518
+ setShuffle(shufflePlaylist: boolean): void;
519
+ /**
520
+ * Returns a number between 0 and 1 that specifies the percentage of the video
521
+ * that the player shows as buffered.
522
+ * @returns {number}
523
+ */
524
+ getVideoLoadedFraction(): number;
525
+ /**
526
+ * Returns the current player state.
527
+ * @returns {YTPlayerState}
528
+ */
529
+ getPlayerState(): YTPlayerState;
530
+ /**
531
+ * Returns the current time in seconds.
532
+ * @returns {number}
533
+ */
534
+ getCurrentTime(): number;
535
+ /**
536
+ * Returns the URL of the current video.
537
+ * @returns {string}
538
+ */
539
+ getVideoUrl(): string;
540
+ /**
541
+ * Returns the embed code of the current video.
542
+ * @returns {string}
543
+ */
544
+ getVideoEmbedCode(): string;
545
+ /**
546
+ * Returns the duration of the video in seconds.
547
+ * @returns {number}
548
+ */
549
+ getDuration(): number;
550
+ /**
551
+ * Returns the array of video IDs in the current playlist.
552
+ * @returns {string[]}
553
+ */
554
+ getPlaylist(): string[];
555
+ /**
556
+ * Returns the index of the current video in the playlist.
557
+ * @returns {number}
558
+ */
559
+ getPlaylistIndex(): number;
560
+ /**
561
+ * Queues a video by its ID.
562
+ * @param {string|VideoByIdOptions} videoId - The ID of the video.
563
+ * @param {number} [startSeconds] - The time to start at.
564
+ * @param {YTQuality} [quality] - The video quality
565
+ * @returns {void}
566
+ */
567
+ cueVideoById(videoId: string | VideoByIdOptions, startSeconds?: number, quality?: YTQuality): void;
568
+ /**
569
+ * Loads a video by its ID.
570
+ * @param {string|VideoByIdOptions} videoId - The ID of the video.
571
+ * @param {number} [startSeconds] - The time to start at.
572
+ * @param {YTQuality} [quality] - The video quality
573
+ * @returns {void}
574
+ */
575
+ loadVideoById(videoId: string | VideoByIdOptions, startSeconds?: number, quality?: YTQuality): void;
576
+ /**
577
+ * Queues a video by its URL.
578
+ * @param {string|VideoByUrlOptions} mediaContentUrl - The full URL of the YouTube video.
579
+ * @param {number} [startSeconds] - The time to start at.
580
+ * @param {YTQuality} [quality] - The video quality
581
+ * @returns {void}
582
+ */
583
+ cueVideoByUrl(mediaContentUrl: string | VideoByUrlOptions, startSeconds?: number, quality?: YTQuality): void;
584
+ /**
585
+ * Loads a video by its URL.
586
+ * @param {string|VideoByUrlOptions} mediaContentUrl - The full URL of the YouTube video.
587
+ * @param {number} [startSeconds] - The time to start at.
588
+ * @param {YTQuality} [quality] - The video quality.
589
+ * @returns {void}
590
+ */
591
+ loadVideoByUrl(mediaContentUrl: string | VideoByUrlOptions, startSeconds?: number, quality?: YTQuality): void;
592
+ /**
593
+ * Queues a playlist.
594
+ * @param {string|string[]|YTPlaylistOptions} playlist - The playlist ID, array of IDs, or options object.
595
+ * @param {number} [index=0] - The index of the first video.
596
+ * @param {number} [startSeconds] - The time to start at.
597
+ * @returns {void}
598
+ */
599
+ cuePlaylist(playlist: string | string[] | YTPlaylistOptions, index?: number, startSeconds?: number): void;
600
+ /**
601
+ * Loads a playlist.
602
+ * @param {string|string[]|YTPlaylistOptions} playlist - The playlist ID, array of IDs, or options object.
603
+ * @param {number} [index=0] - The index of the first video.
604
+ * @param {number} [startSeconds] - The time to start at.
605
+ * @returns {void}
606
+ */
607
+ loadPlaylist(playlist: string | string[] | YTPlaylistOptions, index?: number, startSeconds?: number): void;
608
+ /**
609
+ * Adds an event listener.
610
+ * @param {EventNames} event - The event name.
611
+ * @param {string} listener - The listener is a string that specifies the function
612
+ * that will execute when the specified event fires.
613
+ * @returns {void}
614
+ */
615
+ addEventListener(event: EventNames, listener: string): void;
616
+ /**
617
+ * Removes an event listener.
618
+ * @param {EventNames} event - The event name.
619
+ * @param {string} listener - The listener is a string that identifies the function
620
+ * that will no longer execute when the specified event fires.
621
+ * @returns {void}
622
+ */
623
+ removeEventListener(event: EventNames, listener: string): void;
624
+ /**
625
+ * Returns the DOM node of the <iframe>.
626
+ * @returns {HTMLElement}
627
+ */
628
+ getIframe(): HTMLElement;
629
+ /**
630
+ * Returns the options available for the current module.
631
+ * @param {string} [module] - The name of the module.
632
+ * @returns {Object<string, any>}
633
+ */
634
+ getOptions(module?: string): Record<string, any>;
635
+ /**
636
+ * Retrieves an option for a specific module.
637
+ * @param {any} module - The name of the module.
638
+ * @param {any} option - The name of the option.
639
+ * @returns {any}
640
+ */
641
+ getOption(module: any, option: any): any;
642
+ /**
643
+ * Sets an option for a specific module.
644
+ * @param {any} module - The name of the module.
645
+ * @param {any} option - The name of the option.
646
+ * @param {any} value - The value to set.
647
+ * @returns {void}
648
+ */
649
+ setOption(module: any, option: any, value: any): void;
650
+ /**
651
+ * Destroys the player and removes the <iframe>.
652
+ * @returns {void}
653
+ */
654
+ destroy(): void;
655
+ }
656
+ export default YouTubePlayer;
657
+ //# sourceMappingURL=YouTubePlayer.d.mts.map