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,300 @@
|
|
|
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/SoundCloudWidget.mjs').SoundObject} SoundObject
|
|
8
|
+
* @typedef {import('./docs/SoundCloudWidget.mjs').MediaObject} MediaObject
|
|
9
|
+
* @typedef {import('./docs/SoundCloudWidget.mjs').TranscodingObject} TranscodingObject
|
|
10
|
+
* @typedef {import('./docs/SoundCloudWidget.mjs').PublisherObject} PublisherObject
|
|
11
|
+
* @typedef {import('./docs/SoundCloudWidget.mjs').UserBadgesObject} UserBadgesObject
|
|
12
|
+
* @typedef {import('./docs/SoundCloudWidget.mjs').CreatorSubscriptionObject} CreatorSubscriptionObject
|
|
13
|
+
* @typedef {import('./docs/SoundCloudWidget.mjs').VisualsObject} VisualsObject
|
|
14
|
+
* @typedef {import('./docs/SoundCloudWidget.mjs').VisualsObjectData} VisualsObjectData
|
|
15
|
+
* @typedef {import('./docs/SoundCloudWidget.mjs').UserObject} UserObject
|
|
16
|
+
*/
|
|
17
|
+
export type PictureDataType = import('../../basics/mediaContent.mjs').PictureDataType;
|
|
18
|
+
export type MediaContent = import('../../basics/mediaContent.mjs').MediaContent<PictureDataType>;
|
|
19
|
+
export type ContentTimeData = import('./index.mjs').ContentTimeData;
|
|
20
|
+
export type ContentData = import('./index.mjs').ContentData;
|
|
21
|
+
export type SoundObject = import('./docs/SoundCloudWidget.mjs').SoundObject;
|
|
22
|
+
export type MediaObject = import('./docs/SoundCloudWidget.mjs').MediaObject;
|
|
23
|
+
export type TranscodingObject = import('./docs/SoundCloudWidget.mjs').TranscodingObject;
|
|
24
|
+
export type PublisherObject = import('./docs/SoundCloudWidget.mjs').PublisherObject;
|
|
25
|
+
export type UserBadgesObject = import('./docs/SoundCloudWidget.mjs').UserBadgesObject;
|
|
26
|
+
export type CreatorSubscriptionObject = import('./docs/SoundCloudWidget.mjs').CreatorSubscriptionObject;
|
|
27
|
+
export type VisualsObject = import('./docs/SoundCloudWidget.mjs').VisualsObject;
|
|
28
|
+
export type VisualsObjectData = import('./docs/SoundCloudWidget.mjs').VisualsObjectData;
|
|
29
|
+
export type UserObject = import('./docs/SoundCloudWidget.mjs').UserObject;
|
|
30
|
+
export type HandlerFunc = (...args: any[]) => boolean;
|
|
31
|
+
export type IframeContainerOptions = {
|
|
32
|
+
/**
|
|
33
|
+
* - The SoundCloud song ID to be loaded.
|
|
34
|
+
*/
|
|
35
|
+
videoId: string;
|
|
36
|
+
/**
|
|
37
|
+
* - The iframe width in pixels or a string (e.g., '100%').
|
|
38
|
+
*/
|
|
39
|
+
width?: number | string;
|
|
40
|
+
/**
|
|
41
|
+
* - The iframe height in pixels or a string (e.g., '100%').
|
|
42
|
+
*/
|
|
43
|
+
height?: number | string;
|
|
44
|
+
/**
|
|
45
|
+
* - 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.
|
|
46
|
+
*/
|
|
47
|
+
hidden?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* - If true, the video will start automatically upon loading.
|
|
50
|
+
*/
|
|
51
|
+
autoPlay?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* - The track number to start playback from.
|
|
54
|
+
*/
|
|
55
|
+
startTrack?: null | number;
|
|
56
|
+
/**
|
|
57
|
+
* - The color of the widget's user interface.
|
|
58
|
+
*/
|
|
59
|
+
color?: string | null;
|
|
60
|
+
/**
|
|
61
|
+
* - Whether the "Buy" button is displayed in the widget.
|
|
62
|
+
*/
|
|
63
|
+
buying?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* - Whether the "Share" button is displayed in the widget.
|
|
66
|
+
*/
|
|
67
|
+
sharing?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* - Whether the "Download" button is displayed in the widget.
|
|
70
|
+
*/
|
|
71
|
+
download?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* - Whether the track's artwork is displayed.
|
|
74
|
+
*/
|
|
75
|
+
showArtwork?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* - Whether the play count is displayed.
|
|
78
|
+
*/
|
|
79
|
+
showPlayCount?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* - Whether the user/artist information is displayed.
|
|
82
|
+
*/
|
|
83
|
+
showUser?: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* - Whether to restrict playback to a single active track.
|
|
86
|
+
*/
|
|
87
|
+
singleActive?: boolean;
|
|
88
|
+
};
|
|
89
|
+
import SoundCloudWidget from './docs/SoundCloudWidget.mjs';
|
|
90
|
+
import { BaseMediaAdapter } from './index.mjs';
|
|
91
|
+
/**
|
|
92
|
+
* Method to ensure the SoundCloud Widget API script is loaded.
|
|
93
|
+
*/
|
|
94
|
+
declare const loadSoundCloudApi: () => Promise<any>;
|
|
95
|
+
/**
|
|
96
|
+
* Returns a deep clone of the current YouTube player state values.
|
|
97
|
+
* This ensures the returned object is a copy and does not maintain a reference to the original state.
|
|
98
|
+
* @returns {Record<string, string>} A copy of the Events object.
|
|
99
|
+
*/
|
|
100
|
+
declare const getEventValues: () => Record<string, string>;
|
|
101
|
+
/**
|
|
102
|
+
* Returns the SoundCloud Widget constructor from the global window object.
|
|
103
|
+
* @returns {typeof SoundCloudWidget} The SoundCloud Widget constructor.
|
|
104
|
+
* @throws {Error} If the SoundCloud API is not detected in the global scope.
|
|
105
|
+
*/
|
|
106
|
+
declare const getSCWidget: () => typeof SoundCloudWidget;
|
|
107
|
+
/**
|
|
108
|
+
* Implementation of BaseMediaAdapter for the SoundCloud Widget API.
|
|
109
|
+
* This adapter manages the lifecycle of a SoundCloud widget embedded in a container.
|
|
110
|
+
* @extends BaseMediaAdapter
|
|
111
|
+
*/
|
|
112
|
+
declare class SoundCloudMediaAdapter extends BaseMediaAdapter {
|
|
113
|
+
#private;
|
|
114
|
+
/**
|
|
115
|
+
* Mapping SoundCloud API events for internal adapter events.
|
|
116
|
+
* @type {Record<string, string>}
|
|
117
|
+
* @private
|
|
118
|
+
*/
|
|
119
|
+
private static EVENT_MAPPING;
|
|
120
|
+
/**
|
|
121
|
+
* Static object containing event names to match SC.Widget.Events.
|
|
122
|
+
* @type {Record<string, string>}
|
|
123
|
+
*/
|
|
124
|
+
static Events: Record<string, string>;
|
|
125
|
+
/**
|
|
126
|
+
* Safety lock: If true, multiple instances can share the same player/iframe via WeakMap.
|
|
127
|
+
* If false, only one instance can be bound to a specific container at a time.
|
|
128
|
+
* @type {boolean}
|
|
129
|
+
*/
|
|
130
|
+
static allowInstanceSharing: boolean;
|
|
131
|
+
/**
|
|
132
|
+
* Gets the globally configured default container for SoundCloud players.
|
|
133
|
+
* @returns {HTMLIFrameElement|null}
|
|
134
|
+
*/
|
|
135
|
+
static get defaultContainer(): HTMLIFrameElement | null;
|
|
136
|
+
/**
|
|
137
|
+
* Sets the globally configured default container for SoundCloud players.
|
|
138
|
+
* @param {HTMLIFrameElement|null} element - The element to be used as the default container.
|
|
139
|
+
* @throws {TypeError} If the provided element is not an instance of HTMLIFrameElement.
|
|
140
|
+
*/
|
|
141
|
+
static set defaultContainer(element: HTMLIFrameElement | null);
|
|
142
|
+
/**
|
|
143
|
+
* Creates a SoundCloud iframe element.
|
|
144
|
+
* This element can be used as the `defaultContainer` for the adapter.
|
|
145
|
+
*
|
|
146
|
+
* @param {IframeContainerOptions} options - Configuration for the iframe creation.
|
|
147
|
+
* @returns {HTMLIFrameElement} The created iframe element.
|
|
148
|
+
* @throws {TypeError} If the `videoId` is not a valid string.
|
|
149
|
+
*/
|
|
150
|
+
static createIframeContainer(options: IframeContainerOptions): HTMLIFrameElement;
|
|
151
|
+
/**
|
|
152
|
+
* Returns the thumbnail URL for the currently loaded track.
|
|
153
|
+
* @param {string} trackId - The SoundCloud track ID.
|
|
154
|
+
* @returns {string} The thumbnail URL.
|
|
155
|
+
* @throws {TypeError} If the trackId is not a valid string.
|
|
156
|
+
*/
|
|
157
|
+
static getThumbnailUrl(trackId: string): string;
|
|
158
|
+
get id(): string;
|
|
159
|
+
get loadedProgress(): number;
|
|
160
|
+
get currentContentId(): string | null;
|
|
161
|
+
/**
|
|
162
|
+
* Gets whether the adapter has been destroyed.
|
|
163
|
+
* @returns {boolean}
|
|
164
|
+
*/
|
|
165
|
+
get destroyed(): boolean;
|
|
166
|
+
/**
|
|
167
|
+
* Initializes the SoundCloud Media Adapter.
|
|
168
|
+
* @throws {Error} If allowInstanceSharing is false and the container is already in use.
|
|
169
|
+
*/
|
|
170
|
+
constructor();
|
|
171
|
+
/**
|
|
172
|
+
* @returns {SoundCloudWidget} The current SoundCloud widget instance.
|
|
173
|
+
* @throws {Error} If the widget has not been initialized.
|
|
174
|
+
*/
|
|
175
|
+
get widget(): SoundCloudWidget;
|
|
176
|
+
/**
|
|
177
|
+
* @param {number} value - The volume level from 0.0 to 1.0.
|
|
178
|
+
* @throws {RangeError} If the volume is not between 0.0 and 1.0.
|
|
179
|
+
*/
|
|
180
|
+
set volume(value: number);
|
|
181
|
+
/**
|
|
182
|
+
* @returns {number} The current volume level from 0.0 to 1.0.
|
|
183
|
+
*/
|
|
184
|
+
get volume(): number;
|
|
185
|
+
/**
|
|
186
|
+
* Synchronously checks whether the SoundCloud media adapter is fully initialized and ready.
|
|
187
|
+
* @returns {boolean} True if the adapter is ready, false otherwise.
|
|
188
|
+
*/
|
|
189
|
+
isReady(): boolean;
|
|
190
|
+
/**
|
|
191
|
+
* Asynchronously waits until the SoundCloud media adapter is fully initialized and ready.
|
|
192
|
+
* @returns {Promise<void>} A promise that resolves once the adapter is ready.
|
|
193
|
+
*/
|
|
194
|
+
waitIsReady(): Promise<void>;
|
|
195
|
+
/**
|
|
196
|
+
* Retrieves a consolidated object containing all time-related metrics for the current media content.
|
|
197
|
+
* @returns {ContentTimeData} An object containing total, current, remaining time, and playback percentage.
|
|
198
|
+
*/
|
|
199
|
+
getTimeData(): ContentTimeData;
|
|
200
|
+
/**
|
|
201
|
+
* Determines if the content is a valid SoundCloud URL or ID.
|
|
202
|
+
* @param {MediaContent} content - The media content to evaluate.
|
|
203
|
+
* @returns {boolean} True if the content is a SoundCloud link/ID, false otherwise.
|
|
204
|
+
*/
|
|
205
|
+
static canHandle(content: MediaContent): boolean;
|
|
206
|
+
/**
|
|
207
|
+
* Determines if the content is a valid SoundCloud URL or ID.
|
|
208
|
+
* @param {MediaContent} content - The media content to evaluate.
|
|
209
|
+
* @returns {boolean} True if the content is a SoundCloud link/ID, false otherwise.
|
|
210
|
+
*/
|
|
211
|
+
canHandle(content: MediaContent): boolean;
|
|
212
|
+
/**
|
|
213
|
+
* Plays the media content. If the player is already initialized with a different video,
|
|
214
|
+
* it will load the new video automatically.
|
|
215
|
+
*
|
|
216
|
+
* Example: https://api.soundcloud.com/tracks/XXXXXXXXX (From SoundCloud Embed)
|
|
217
|
+
* @param {MediaContent} content - The media content to play.
|
|
218
|
+
* @returns {Promise<void>}
|
|
219
|
+
* @throws {TypeError} If the content data is invalid.
|
|
220
|
+
* @throws {Error} If the track fails to load within the timeout period.
|
|
221
|
+
*/
|
|
222
|
+
play(content: MediaContent): Promise<void>;
|
|
223
|
+
/**
|
|
224
|
+
* Pauses the current playback.
|
|
225
|
+
* @returns {Promise<void>}
|
|
226
|
+
*/
|
|
227
|
+
pause(): Promise<void>;
|
|
228
|
+
/**
|
|
229
|
+
* Stops the playback completely.
|
|
230
|
+
* @returns {Promise<void>}
|
|
231
|
+
*/
|
|
232
|
+
stop(): Promise<void>;
|
|
233
|
+
/**
|
|
234
|
+
* Seeks to a specific time in the media timeline.
|
|
235
|
+
* @param {number} timeMs - The target time in milliseconds.
|
|
236
|
+
* @returns {Promise<void>}
|
|
237
|
+
* @throws {TypeError} If timeMs is not a number.
|
|
238
|
+
*/
|
|
239
|
+
seek(timeMs: number): Promise<void>;
|
|
240
|
+
/**
|
|
241
|
+
* Retrieves the current playback time.
|
|
242
|
+
* @returns {number} The current time in milliseconds.
|
|
243
|
+
*/
|
|
244
|
+
getCurrentTime(): number;
|
|
245
|
+
/**
|
|
246
|
+
* Gets the total duration of the YouTube video.
|
|
247
|
+
* @returns {number} The total duration in milliseconds.
|
|
248
|
+
*/
|
|
249
|
+
getTotalDuration(): number;
|
|
250
|
+
/**
|
|
251
|
+
* Gets the remaining time until the YouTube video ends.
|
|
252
|
+
* @returns {number} The remaining time in milliseconds.
|
|
253
|
+
*/
|
|
254
|
+
getRemainingTime(): number;
|
|
255
|
+
/**
|
|
256
|
+
* Gets the percentage of the YouTube video that has been played.
|
|
257
|
+
* @returns {number} The percentage from 0 to 100.
|
|
258
|
+
*/
|
|
259
|
+
getPlaybackPercentage(): number;
|
|
260
|
+
/**
|
|
261
|
+
* Sets the playback volume.
|
|
262
|
+
* @param {number} volume - The volume level from 0.0 to 1.0.
|
|
263
|
+
* @returns {void}
|
|
264
|
+
* @throws {RangeError} If volume is outside [0.0, 1.0].
|
|
265
|
+
*/
|
|
266
|
+
setVolume(volume: number): void;
|
|
267
|
+
/**
|
|
268
|
+
* Gets the playback volume.
|
|
269
|
+
* @returns {number}
|
|
270
|
+
* @throws {RangeError} If volume is outside [0.0, 1.0].
|
|
271
|
+
*/
|
|
272
|
+
getVolume(): number;
|
|
273
|
+
/**
|
|
274
|
+
* Retrieves the thumbnail URL for the currently loaded video with a specified quality.
|
|
275
|
+
* @returns {string|null} The thumbnail URL or null if no video is loaded.
|
|
276
|
+
*/
|
|
277
|
+
getThumbnailUrl(): string | null;
|
|
278
|
+
/**
|
|
279
|
+
* Retrieves the metadata of the currently loaded SoundCloud music, returning a structured
|
|
280
|
+
* object containing details such as the audio ID, title, author, and duration.
|
|
281
|
+
* @returns {Promise<ContentData>}
|
|
282
|
+
*/
|
|
283
|
+
getContentData(): Promise<ContentData>;
|
|
284
|
+
/**
|
|
285
|
+
* Cleans up the instance and disconnects from the shared player.
|
|
286
|
+
*/
|
|
287
|
+
destroy(): void;
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Asynchronously ensures the SoundCloud IFrame API is loaded and returns
|
|
291
|
+
* the SoundCloud Player constructor and the current player state mapping.
|
|
292
|
+
*
|
|
293
|
+
* @returns {Promise<{ Widget: typeof SoundCloudWidget }>}
|
|
294
|
+
* An object containing the Player constructor and the current player state mapping.
|
|
295
|
+
*/
|
|
296
|
+
declare const getSC: () => Promise<{
|
|
297
|
+
Widget: typeof SoundCloudWidget;
|
|
298
|
+
}>;
|
|
299
|
+
export { SoundCloudMediaAdapter, getEventValues, getSCWidget, loadSoundCloudApi, getSC };
|
|
300
|
+
//# sourceMappingURL=SoundCloud.d.mts.map
|