tiny-essentials 1.28.4 → 1.28.6
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/README.md +18 -1
- package/changelog/1/28/5.md +31 -0
- package/changelog/1/28/6.md +11 -0
- package/dist/v1/TinyAdvancedRaffle.min.js +1 -1
- package/dist/v1/TinyBasicsEs.min.js +1 -1
- package/dist/v1/TinyEssentials.min.js +1 -1
- package/dist/v1/TinyIframeEvents.min.js +1 -1
- package/dist/v1/TinyLocalStorage.min.js +1 -1
- package/dist/v1/TinyMediaPlayer.min.js +1 -1
- package/dist/v1/TinyNewWinEvents.min.js +1 -1
- package/dist/v1/TinyRadioFm.min.js +1 -1
- package/dist/v1/TinySmartScroller.min.js +1 -1
- package/dist/v1/TinyTimeout.min.js +1 -1
- package/dist/v1/TinyUploadClicker.min.js +1 -1
- package/dist/v1/basics/index.cjs +4 -0
- package/dist/v1/basics/index.d.mts +3 -2
- package/dist/v1/basics/index.mjs +3 -2
- package/dist/v1/basics/mediaContent.cjs +1 -0
- package/dist/v1/basics/mediaContent.d.mts +4 -0
- package/dist/v1/basics/mediaContent.mjs +1 -0
- package/dist/v1/basics/objChecker.cjs +16 -0
- package/dist/v1/basics/objChecker.d.mts +12 -0
- package/dist/v1/basics/objChecker.mjs +14 -0
- package/dist/v1/basics/objFilter.cjs +0 -2
- package/dist/v1/basics/objFilter.d.mts +0 -2
- package/dist/v1/basics/objFilter.mjs +1 -2
- package/dist/v1/basics/promiseUtils.cjs +101 -0
- package/dist/v1/basics/promiseUtils.d.mts +31 -0
- package/dist/v1/basics/promiseUtils.mjs +89 -0
- package/dist/v1/css/TinyLoadingScreen.min.css +1 -1
- package/dist/v1/index.cjs +4 -0
- package/dist/v1/index.d.mts +3 -2
- package/dist/v1/index.mjs +3 -2
- package/dist/v1/libs/TinyMediaPlayer/HtmlAudio.cjs +318 -0
- package/dist/v1/libs/TinyMediaPlayer/HtmlAudio.d.mts +143 -0
- package/dist/v1/libs/TinyMediaPlayer/HtmlAudio.mjs +283 -0
- package/dist/v1/libs/TinyMediaPlayer/HtmlVideo.cjs +315 -0
- package/dist/v1/libs/TinyMediaPlayer/HtmlVideo.d.mts +143 -0
- package/dist/v1/libs/TinyMediaPlayer/HtmlVideo.mjs +280 -0
- package/dist/v1/libs/TinyMediaPlayer/SoundCloud.cjs +792 -0
- package/dist/v1/libs/TinyMediaPlayer/SoundCloud.d.mts +300 -0
- package/dist/v1/libs/TinyMediaPlayer/SoundCloud.mjs +697 -0
- package/dist/v1/libs/TinyMediaPlayer/Youtube.cjs +783 -0
- package/dist/v1/libs/TinyMediaPlayer/Youtube.d.mts +355 -0
- package/dist/v1/libs/TinyMediaPlayer/Youtube.mjs +694 -0
- package/dist/v1/libs/TinyMediaPlayer/docs/SoundCloudWidget.cjs +381 -0
- package/dist/v1/libs/TinyMediaPlayer/docs/SoundCloudWidget.d.mts +704 -0
- package/dist/v1/libs/TinyMediaPlayer/docs/SoundCloudWidget.mjs +343 -0
- package/dist/v1/libs/TinyMediaPlayer/docs/YouTubePlayer.cjs +546 -0
- package/dist/v1/libs/TinyMediaPlayer/docs/YouTubePlayer.d.mts +657 -0
- package/dist/v1/libs/TinyMediaPlayer/docs/YouTubePlayer.mjs +480 -0
- package/dist/v1/libs/TinyMediaPlayer/index.cjs +216 -0
- package/dist/v1/libs/TinyMediaPlayer/index.d.mts +162 -0
- package/dist/v1/libs/TinyMediaPlayer/index.mjs +190 -0
- package/dist/v1/libs/TinyMediaPlayer.cjs +627 -103
- package/dist/v1/libs/TinyMediaPlayer.d.mts +163 -65
- package/dist/v1/libs/TinyMediaPlayer.mjs +573 -93
- package/dist/v1/libs/TinyTimeout.cjs +4 -14
- package/dist/v1/libs/TinyTimeout.d.mts +1 -0
- package/dist/v1/libs/TinyTimeout.mjs +4 -13
- package/docs/v1/basics/mediaContent.md +1 -1
- package/docs/v1/basics/objChecker.md +13 -0
- package/docs/v1/basics/promiseUtils.md +32 -0
- package/docs/v1/libs/TinyMediaPlayer.md +268 -39
- package/docs/v1/libs/TinyTimeout.md +1 -14
- package/package.json +71 -10
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {import('../../basics/mediaContent.mjs').PictureDataType} PictureDataType
|
|
3
|
+
* @typedef {import('../../basics/mediaContent.mjs').MediaContent<PictureDataType>} MediaContent
|
|
4
|
+
* @typedef {import('./index.mjs').ContentTimeData} ContentTimeData
|
|
5
|
+
* @typedef {import('./index.mjs').ContentData} ContentData
|
|
6
|
+
*
|
|
7
|
+
* @typedef {import('./docs/YouTubePlayer.mjs').YTPlayerState} YTPlayerState
|
|
8
|
+
* @typedef {import('./docs/YouTubePlayer.mjs').YTPlayerErrors} YTPlayerErrors
|
|
9
|
+
* @typedef {import('./docs/YouTubePlayer.mjs').YTQuality} YTQuality
|
|
10
|
+
* @typedef {import('./docs/YouTubePlayer.mjs').YTSphericalProperties} YTSphericalProperties
|
|
11
|
+
* @typedef {import('./docs/YouTubePlayer.mjs').YouTubePlayerEventBase} YouTubePlayerEventBase
|
|
12
|
+
* @typedef {import('./docs/YouTubePlayer.mjs').YTPlayerOptionsEvents} YTPlayerOptionsEvents
|
|
13
|
+
* @typedef {import('./docs/YouTubePlayer.mjs').YTPlayerOptionsEvents} YTPlayerOptions
|
|
14
|
+
* @typedef {import('./docs/YouTubePlayer.mjs').EventNames} EventNames
|
|
15
|
+
* @typedef {import('./docs/YouTubePlayer.mjs').YTPlaylistOptions} YTPlaylistOptions
|
|
16
|
+
* @typedef {import('./docs/YouTubePlayer.mjs').VideoByUrlOptions} VideoByUrlOptions
|
|
17
|
+
* @typedef {import('./docs/YouTubePlayer.mjs').VideoByIdOptions} VideoByIdOptions
|
|
18
|
+
*
|
|
19
|
+
* @typedef {import('./docs/YouTubePlayer.mjs').OnReadyEvent} OnReadyEvent
|
|
20
|
+
* @typedef {import('./docs/YouTubePlayer.mjs').OnStateChangeEvent} OnStateChangeEvent
|
|
21
|
+
* @typedef {import('./docs/YouTubePlayer.mjs').OnErrorEvent} OnErrorEvent
|
|
22
|
+
* @typedef {import('./docs/YouTubePlayer.mjs').OnPlaybackQualityChangeEvent} OnPlaybackQualityChangeEvent
|
|
23
|
+
* @typedef {import('./docs/YouTubePlayer.mjs').OnPlaybackRateChangeEvent} OnPlaybackRateChangeEvent
|
|
24
|
+
* @typedef {import('./docs/YouTubePlayer.mjs').OnApiChangeEvent} OnApiChangeEvent
|
|
25
|
+
* @typedef {import('./docs/YouTubePlayer.mjs').OnAutoplayBlockedEvent} OnAutoplayBlockedEvent
|
|
26
|
+
*/
|
|
27
|
+
export type PictureDataType = import('../../basics/mediaContent.mjs').PictureDataType;
|
|
28
|
+
export type MediaContent = import('../../basics/mediaContent.mjs').MediaContent<PictureDataType>;
|
|
29
|
+
export type ContentTimeData = import('./index.mjs').ContentTimeData;
|
|
30
|
+
export type ContentData = import('./index.mjs').ContentData;
|
|
31
|
+
export type YTPlayerState = import('./docs/YouTubePlayer.mjs').YTPlayerState;
|
|
32
|
+
export type YTPlayerErrors = import('./docs/YouTubePlayer.mjs').YTPlayerErrors;
|
|
33
|
+
export type YTQuality = import('./docs/YouTubePlayer.mjs').YTQuality;
|
|
34
|
+
export type YTSphericalProperties = import('./docs/YouTubePlayer.mjs').YTSphericalProperties;
|
|
35
|
+
export type YouTubePlayerEventBase = import('./docs/YouTubePlayer.mjs').YouTubePlayerEventBase;
|
|
36
|
+
export type YTPlayerOptionsEvents = import('./docs/YouTubePlayer.mjs').YTPlayerOptionsEvents;
|
|
37
|
+
export type YTPlayerOptions = import('./docs/YouTubePlayer.mjs').YTPlayerOptionsEvents;
|
|
38
|
+
export type EventNames = import('./docs/YouTubePlayer.mjs').EventNames;
|
|
39
|
+
export type YTPlaylistOptions = import('./docs/YouTubePlayer.mjs').YTPlaylistOptions;
|
|
40
|
+
export type VideoByUrlOptions = import('./docs/YouTubePlayer.mjs').VideoByUrlOptions;
|
|
41
|
+
export type VideoByIdOptions = import('./docs/YouTubePlayer.mjs').VideoByIdOptions;
|
|
42
|
+
export type OnReadyEvent = import('./docs/YouTubePlayer.mjs').OnReadyEvent;
|
|
43
|
+
export type OnStateChangeEvent = import('./docs/YouTubePlayer.mjs').OnStateChangeEvent;
|
|
44
|
+
export type OnErrorEvent = import('./docs/YouTubePlayer.mjs').OnErrorEvent;
|
|
45
|
+
export type OnPlaybackQualityChangeEvent = import('./docs/YouTubePlayer.mjs').OnPlaybackQualityChangeEvent;
|
|
46
|
+
export type OnPlaybackRateChangeEvent = import('./docs/YouTubePlayer.mjs').OnPlaybackRateChangeEvent;
|
|
47
|
+
export type OnApiChangeEvent = import('./docs/YouTubePlayer.mjs').OnApiChangeEvent;
|
|
48
|
+
export type OnAutoplayBlockedEvent = import('./docs/YouTubePlayer.mjs').OnAutoplayBlockedEvent;
|
|
49
|
+
export type HandlerFunc = (...args: any[]) => boolean;
|
|
50
|
+
export type IframeContainerOptions = {
|
|
51
|
+
/**
|
|
52
|
+
* - The YouTube video ID to be loaded.
|
|
53
|
+
*/
|
|
54
|
+
videoId: string;
|
|
55
|
+
/**
|
|
56
|
+
* - The iframe width in pixels or a string (e.g., '100%').
|
|
57
|
+
*/
|
|
58
|
+
width?: number | string;
|
|
59
|
+
/**
|
|
60
|
+
* - The iframe height in pixels or a string (e.g., '100%').
|
|
61
|
+
*/
|
|
62
|
+
height?: number | string;
|
|
63
|
+
/**
|
|
64
|
+
* - If true, the iframe will be invisible (opacity 0) and will not respond to clicks (pointer-events none) and appends it to the document body.
|
|
65
|
+
*/
|
|
66
|
+
hidden?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* - If true, the video will start automatically upon loading.
|
|
69
|
+
*/
|
|
70
|
+
autoplay?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* - The ID of a playlist to load.
|
|
73
|
+
*/
|
|
74
|
+
list?: string | null;
|
|
75
|
+
/**
|
|
76
|
+
* - The type of list to load (e.g., 'playlist').
|
|
77
|
+
*/
|
|
78
|
+
listType?: string | null;
|
|
79
|
+
/**
|
|
80
|
+
* - The preferred language for closed captions.
|
|
81
|
+
*/
|
|
82
|
+
ccLangPref?: string | null;
|
|
83
|
+
/**
|
|
84
|
+
* - Whether to load closed captions by default (0 for off, 1 for on).
|
|
85
|
+
*/
|
|
86
|
+
ccLoadPolicy?: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* - The color of the player controls (e.g., 'red', 'white').
|
|
89
|
+
*/
|
|
90
|
+
color?: string | null;
|
|
91
|
+
/**
|
|
92
|
+
* - Whether to display the player controls.
|
|
93
|
+
*/
|
|
94
|
+
controls?: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* - Whether to disable keyboard controls.
|
|
97
|
+
*/
|
|
98
|
+
disableKb?: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* - Whether the video should loop.
|
|
101
|
+
*/
|
|
102
|
+
loop?: boolean;
|
|
103
|
+
/**
|
|
104
|
+
* - The time in seconds when the video should end.
|
|
105
|
+
*/
|
|
106
|
+
end?: number | string | null;
|
|
107
|
+
/**
|
|
108
|
+
* - The time in seconds when the video should start.
|
|
109
|
+
*/
|
|
110
|
+
start?: number | string | null;
|
|
111
|
+
/**
|
|
112
|
+
* - A comma-separated list of video IDs to be played as a playlist.
|
|
113
|
+
*/
|
|
114
|
+
playlist?: string | string[] | null;
|
|
115
|
+
/**
|
|
116
|
+
* - Whether to play the video inline on mobile devices.
|
|
117
|
+
*/
|
|
118
|
+
playsinline?: boolean;
|
|
119
|
+
/**
|
|
120
|
+
* - The URL of the page where the player is embedded.
|
|
121
|
+
*/
|
|
122
|
+
widgetReferrer?: string | null;
|
|
123
|
+
/**
|
|
124
|
+
* - Whether to show related videos from the same channel.
|
|
125
|
+
*/
|
|
126
|
+
rel?: boolean;
|
|
127
|
+
/**
|
|
128
|
+
* - The language of the player interface.
|
|
129
|
+
*/
|
|
130
|
+
hl?: string | null;
|
|
131
|
+
/**
|
|
132
|
+
* - Whether to allow the player to enter fullscreen mode.
|
|
133
|
+
*/
|
|
134
|
+
fs?: boolean;
|
|
135
|
+
/**
|
|
136
|
+
* - The policy for showing video annotations (1 to show, 3 to hide).
|
|
137
|
+
*/
|
|
138
|
+
ivLoadPolicy?: boolean;
|
|
139
|
+
};
|
|
140
|
+
import { BaseMediaAdapter } from './index.mjs';
|
|
141
|
+
import YouTubePlayer from './docs/YouTubePlayer.mjs';
|
|
142
|
+
/**
|
|
143
|
+
* Method to ensure the YouTube IFrame API script is loaded.
|
|
144
|
+
*/
|
|
145
|
+
declare const loadYoutubeApi: () => Promise<any>;
|
|
146
|
+
/**
|
|
147
|
+
* Returns a deep clone of the current YouTube player state values.
|
|
148
|
+
* This ensures the returned object is a copy and does not maintain a reference to the original state.
|
|
149
|
+
* @returns {Record<string, number>} A copy of the PlayerState object.
|
|
150
|
+
*/
|
|
151
|
+
declare const getPlayerStateValues: () => Record<string, number>;
|
|
152
|
+
/**
|
|
153
|
+
* Retrieves the YouTube Player constructor from the global window object.
|
|
154
|
+
* @returns {typeof YouTubePlayer} The YouTube Player constructor.
|
|
155
|
+
* @throws {Error} If the YouTube API is not detected in the global scope.
|
|
156
|
+
*/
|
|
157
|
+
declare const getYtPlayer: () => typeof YouTubePlayer;
|
|
158
|
+
/**
|
|
159
|
+
* Implementation of BaseMediaAdapter for the YouTube IFrame Player API.
|
|
160
|
+
* This adapter manages the lifecycle of a YouTube player embedded in a container.
|
|
161
|
+
* @extends BaseMediaAdapter
|
|
162
|
+
*/
|
|
163
|
+
declare class YoutubeMediaAdapter extends BaseMediaAdapter {
|
|
164
|
+
#private;
|
|
165
|
+
/**
|
|
166
|
+
* Mapping YouTube API events for internal adapter events.
|
|
167
|
+
* Includes semantic events triggered by state changes.
|
|
168
|
+
* @type {Record<string, string>}
|
|
169
|
+
* @private
|
|
170
|
+
*/
|
|
171
|
+
private static EVENT_MAPPING;
|
|
172
|
+
/**
|
|
173
|
+
* Represents the current state of the player.
|
|
174
|
+
* @type {Record<string, number>}
|
|
175
|
+
*/
|
|
176
|
+
static PlayerState: Record<string, number>;
|
|
177
|
+
/**
|
|
178
|
+
* Safety lock: If true, multiple instances can share the same player/iframe via WeakMap.
|
|
179
|
+
* If false, only one instance can be bound to a specific container at a time.
|
|
180
|
+
* @type {boolean}
|
|
181
|
+
*/
|
|
182
|
+
static allowInstanceSharing: boolean;
|
|
183
|
+
/**
|
|
184
|
+
* Gets the globally configured default container for YouTube players.
|
|
185
|
+
* @returns {HTMLIFrameElement|null}
|
|
186
|
+
*/
|
|
187
|
+
static get defaultContainer(): HTMLIFrameElement | null;
|
|
188
|
+
/**
|
|
189
|
+
* Sets the globally configured default container for YouTube players.
|
|
190
|
+
* @param {HTMLIFrameElement|null} element - The element to be used as the default container.
|
|
191
|
+
* @throws {TypeError} If the provided element is not an instance of HTMLIFrameElement.
|
|
192
|
+
*/
|
|
193
|
+
static set defaultContainer(element: HTMLIFrameElement | null);
|
|
194
|
+
/**
|
|
195
|
+
* Creates a YouTube iframe element.
|
|
196
|
+
* This element can be used as the `defaultContainer` for the adapter.
|
|
197
|
+
*
|
|
198
|
+
* @param {IframeContainerOptions} options - Configuration for the iframe creation.
|
|
199
|
+
* @returns {HTMLIFrameElement} The created iframe element.
|
|
200
|
+
* @throws {TypeError} If the `videoId` is not a valid string.
|
|
201
|
+
*/
|
|
202
|
+
static createIframeContainer(options: IframeContainerOptions): HTMLIFrameElement;
|
|
203
|
+
/**
|
|
204
|
+
* Returns the URL for a YouTube video thumbnail with a specified quality.
|
|
205
|
+
* @param {string} videoId - The YouTube video ID.
|
|
206
|
+
* @param {string} [quality='maxresdefault'] - The thumbnail quality (e.g., 'default', 'mqdefault', 'hqdefault', 'sddefault', 'maxresdefault').
|
|
207
|
+
* @returns {string} The thumbnail URL.
|
|
208
|
+
* @throws {TypeError} If the videoId is not a valid string.
|
|
209
|
+
*/
|
|
210
|
+
static getThumbnailUrl(videoId: string, quality?: string): string;
|
|
211
|
+
get id(): string;
|
|
212
|
+
get currentContentId(): string | null;
|
|
213
|
+
get pollingTimeUpdateValue(): number;
|
|
214
|
+
set pollingTimeUpdateValue(timeMs: number);
|
|
215
|
+
/**
|
|
216
|
+
* Gets whether the adapter has been destroyed.
|
|
217
|
+
* @returns {boolean}
|
|
218
|
+
*/
|
|
219
|
+
get destroyed(): boolean;
|
|
220
|
+
/**
|
|
221
|
+
* Initializes the YouTube Media Adapter.
|
|
222
|
+
* @throws {Error} If allowInstanceSharing is false and the container is already in use.
|
|
223
|
+
*/
|
|
224
|
+
constructor();
|
|
225
|
+
/**
|
|
226
|
+
* @returns {YouTubePlayer} The current YouTube player instance.
|
|
227
|
+
* @throws {Error} If the player has not been initialized.
|
|
228
|
+
*/
|
|
229
|
+
get player(): YouTubePlayer;
|
|
230
|
+
/**
|
|
231
|
+
* @param {number} value - The volume level from 0.0 to 1.0.
|
|
232
|
+
* @throws {RangeError} If the volume is not between 0.0 and 1.0.
|
|
233
|
+
*/
|
|
234
|
+
set volume(value: number);
|
|
235
|
+
/**
|
|
236
|
+
* @returns {number} The current volume level from 0.0 to 1.0.
|
|
237
|
+
*/
|
|
238
|
+
get volume(): number;
|
|
239
|
+
/**
|
|
240
|
+
* Synchronously checks whether the YouTube media adapter is fully initialized and ready.
|
|
241
|
+
* @returns {boolean} True if the adapter is ready, false otherwise.
|
|
242
|
+
*/
|
|
243
|
+
isReady(): boolean;
|
|
244
|
+
/**
|
|
245
|
+
* Asynchronously waits until the YouTube media adapter is fully initialized and ready.
|
|
246
|
+
* @returns {Promise<void>} A promise that resolves once the adapter is ready.
|
|
247
|
+
*/
|
|
248
|
+
waitIsReady(): Promise<void>;
|
|
249
|
+
/**
|
|
250
|
+
* Retrieves a consolidated object containing all time-related metrics for the current media content.
|
|
251
|
+
* @returns {ContentTimeData} An object containing total, current, remaining time, and playback percentage.
|
|
252
|
+
*/
|
|
253
|
+
getTimeData(): ContentTimeData;
|
|
254
|
+
/**
|
|
255
|
+
* Determines if the content is a valid YouTube URL or ID.
|
|
256
|
+
* @param {MediaContent} content - The media content to evaluate.
|
|
257
|
+
* @returns {boolean} True if the content is a YouTube link/ID, false otherwise.
|
|
258
|
+
*/
|
|
259
|
+
static canHandle(content: MediaContent): boolean;
|
|
260
|
+
/**
|
|
261
|
+
* Determines if the content is a valid YouTube URL or ID.
|
|
262
|
+
* @param {MediaContent} content - The media content to evaluate.
|
|
263
|
+
* @returns {boolean} True if the content is a YouTube link/ID, false otherwise.
|
|
264
|
+
*/
|
|
265
|
+
canHandle(content: MediaContent): boolean;
|
|
266
|
+
/**
|
|
267
|
+
* Plays the media content. If the player is already initialized with a different video,
|
|
268
|
+
* it will load the new video automatically.
|
|
269
|
+
*
|
|
270
|
+
* Example: https://www.youtube.com/watch?v=XXXXXXXXXXX
|
|
271
|
+
* @param {MediaContent} content - The media content to play.
|
|
272
|
+
* @returns {Promise<void>}
|
|
273
|
+
* @throws {TypeError} If the content data is invalid.
|
|
274
|
+
*/
|
|
275
|
+
play(content: MediaContent): Promise<void>;
|
|
276
|
+
/**
|
|
277
|
+
* Pauses the current playback.
|
|
278
|
+
* @returns {Promise<void>}
|
|
279
|
+
*/
|
|
280
|
+
pause(): Promise<void>;
|
|
281
|
+
/**
|
|
282
|
+
* Stops the playback completely.
|
|
283
|
+
* @returns {Promise<void>}
|
|
284
|
+
*/
|
|
285
|
+
stop(): Promise<void>;
|
|
286
|
+
/**
|
|
287
|
+
* Seeks to a specific time in the media timeline.
|
|
288
|
+
* @param {number} timeMs - The target time in milliseconds.
|
|
289
|
+
* @returns {Promise<void>}
|
|
290
|
+
* @throws {TypeError} If timeMs is not a number.
|
|
291
|
+
*/
|
|
292
|
+
seek(timeMs: number): Promise<void>;
|
|
293
|
+
/**
|
|
294
|
+
* Retrieves the current playback time.
|
|
295
|
+
* @returns {number} The current time in milliseconds.
|
|
296
|
+
*/
|
|
297
|
+
getCurrentTime(): number;
|
|
298
|
+
/**
|
|
299
|
+
* Gets the total duration of the YouTube video.
|
|
300
|
+
* @returns {number} The total duration in milliseconds.
|
|
301
|
+
*/
|
|
302
|
+
getTotalDuration(): number;
|
|
303
|
+
/**
|
|
304
|
+
* Gets the remaining time until the YouTube video ends.
|
|
305
|
+
* @returns {number} The remaining time in milliseconds.
|
|
306
|
+
*/
|
|
307
|
+
getRemainingTime(): number;
|
|
308
|
+
/**
|
|
309
|
+
* Gets the percentage of the YouTube video that has been played.
|
|
310
|
+
* @returns {number} The percentage from 0 to 100.
|
|
311
|
+
*/
|
|
312
|
+
getPlaybackPercentage(): number;
|
|
313
|
+
/**
|
|
314
|
+
* Sets the playback volume.
|
|
315
|
+
* @param {number} volume - The volume level from 0.0 to 1.0.
|
|
316
|
+
* @returns {void}
|
|
317
|
+
* @throws {RangeError} If volume is outside [0.0, 1.0].
|
|
318
|
+
*/
|
|
319
|
+
setVolume(volume: number): void;
|
|
320
|
+
/**
|
|
321
|
+
* Gets the playback volume.
|
|
322
|
+
* @returns {number}
|
|
323
|
+
* @throws {RangeError} If volume is outside [0.0, 1.0].
|
|
324
|
+
*/
|
|
325
|
+
getVolume(): number;
|
|
326
|
+
/**
|
|
327
|
+
* Retrieves the thumbnail URL for the currently loaded video with a specified quality.
|
|
328
|
+
* @param {string} [quality='maxresdefault'] - The thumbnail quality.
|
|
329
|
+
* @returns {string|null} The thumbnail URL or null if no video is loaded.
|
|
330
|
+
*/
|
|
331
|
+
getThumbnailUrl(quality?: string): string | null;
|
|
332
|
+
/**
|
|
333
|
+
* Retrieves the metadata of the currently loaded YouTube video, returning a structured
|
|
334
|
+
* object containing details such as the video ID, title, author, and duration.
|
|
335
|
+
* @returns {Promise<ContentData>}
|
|
336
|
+
*/
|
|
337
|
+
getContentData(): Promise<ContentData>;
|
|
338
|
+
/**
|
|
339
|
+
* Cleans up the instance and disconnects from the shared player.
|
|
340
|
+
*/
|
|
341
|
+
destroy(): void;
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* Asynchronously ensures the YouTube IFrame API is loaded and returns
|
|
345
|
+
* the YouTube Player constructor and the current player state mapping.
|
|
346
|
+
*
|
|
347
|
+
* @returns {Promise<{ Player: typeof YouTubePlayer, PlayerState: Record<string, number> }>}
|
|
348
|
+
* An object containing the Player constructor and the current player state mapping.
|
|
349
|
+
*/
|
|
350
|
+
declare const getYT: () => Promise<{
|
|
351
|
+
Player: typeof YouTubePlayer;
|
|
352
|
+
PlayerState: Record<string, number>;
|
|
353
|
+
}>;
|
|
354
|
+
export { YoutubeMediaAdapter, getYtPlayer, loadYoutubeApi, getPlayerStateValues, getYT };
|
|
355
|
+
//# sourceMappingURL=Youtube.d.mts.map
|