@devix-technologies/react-gjirafa-vp-player 1.0.2 → 1.0.4
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/dist/react-gjirafa-vp-player.es.js +751 -689
- package/dist/react-gjirafa-vp-player.umd.js +9 -9
- package/package.json +1 -1
- package/dist/App.d.ts +0 -2
- package/dist/components/Feedback.d.ts +0 -25
- package/dist/components/VPPlayer/index.d.ts +0 -2
- package/dist/components/VPPlayer/ui/index.d.ts +0 -1
- package/dist/components/VPPlayer/ui/styled.d.ts +0 -42
- package/dist/config/index.d.ts +0 -1
- package/dist/config/vpPlayerConfig.d.ts +0 -9
- package/dist/constants/configs.d.ts +0 -22
- package/dist/constants/index.d.ts +0 -1
- package/dist/constants/storybook.d.ts +0 -11
- package/dist/constants/styles.d.ts +0 -11
- package/dist/constants/urls.d.ts +0 -18
- package/dist/constants/vpPlayer.d.ts +0 -29
- package/dist/contexts/VPPlayerContext.d.ts +0 -53
- package/dist/contexts/index.d.ts +0 -1
- package/dist/features/VPPlayer.d.ts +0 -27
- package/dist/features/index.d.ts +0 -1
- package/dist/features/stories/ads/Ads.stories.d.ts +0 -13
- package/dist/features/stories/context/Context.stories.d.ts +0 -10
- package/dist/features/stories/index.d.ts +0 -3
- package/dist/features/stories/playback/Playback.stories.d.ts +0 -15
- package/dist/fixtures/index.d.ts +0 -1
- package/dist/fixtures/playlist.d.ts +0 -11
- package/dist/hooks/index.d.ts +0 -3
- package/dist/hooks/useVPPlayerLogic.d.ts +0 -16
- package/dist/hooks/useVPPlayerScript.d.ts +0 -13
- package/dist/hooks/useVideoData.d.ts +0 -21
- package/dist/index.d.ts +0 -2
- package/dist/interfaces/config.d.ts +0 -303
- package/dist/interfaces/index.d.ts +0 -3
- package/dist/interfaces/instance.d.ts +0 -11
- package/dist/interfaces/props.d.ts +0 -54
- package/dist/main.d.ts +0 -1
- package/dist/types/api.types.d.ts +0 -50
- package/dist/types/index.d.ts +0 -1
- package/dist/utils/index.d.ts +0 -2
- package/dist/utils/vpPlayerConfigBuilder.d.ts +0 -29
- package/dist/utils/vpPlayerUtils.d.ts +0 -8
package/dist/hooks/index.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { VPPlayerInstance, VPPlayerProps } from "@/interfaces";
|
|
2
|
-
/**
|
|
3
|
-
* Custom hook to manage VP Player logic, including fetching video data,
|
|
4
|
-
* initializing the player, and handling lifecycle events.
|
|
5
|
-
*
|
|
6
|
-
* @function
|
|
7
|
-
* @param {VPPlayerProps} props - The properties required to configure the VP Player.
|
|
8
|
-
* @returns {Object} An object containing player references, script loading status, loading state, and errors.
|
|
9
|
-
*/
|
|
10
|
-
export declare const useVPPlayerLogic: ({ playerId, videoId: propVideoId, version, videoUrl, projectId, playlistId, scriptUrl, config, apiKey, isReels, }: VPPlayerProps) => {
|
|
11
|
-
playerRef: import("react").RefObject<HTMLDivElement | null>;
|
|
12
|
-
playerInstanceRef: import("react").RefObject<VPPlayerInstance | null>;
|
|
13
|
-
isScriptLoaded: boolean;
|
|
14
|
-
isLoading: boolean;
|
|
15
|
-
error: string | null;
|
|
16
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Custom hook to dynamically load the VP Player script into the document.
|
|
3
|
-
* It ensures that the script is only loaded once and provides a loading state.
|
|
4
|
-
*
|
|
5
|
-
* @function
|
|
6
|
-
* @param {string | null} [version] - The version of the VP Player script to load (defaults to "latest").
|
|
7
|
-
* @param {string} [scriptUrl] - Custom script URL (if provided, it overrides the version-based URL).
|
|
8
|
-
* @returns {{ isLoaded: boolean; error: string | null }} Indicates load success and any error message.
|
|
9
|
-
*/
|
|
10
|
-
export declare const useVPPlayerScript: (version?: string | null, scriptUrl?: string) => {
|
|
11
|
-
isLoaded: boolean;
|
|
12
|
-
error: string | null;
|
|
13
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { VideoDataResult } from "@/types";
|
|
2
|
-
/**
|
|
3
|
-
* Custom hook for fetching video data, including playback URLs and playlists.
|
|
4
|
-
* Supports retry logic, timeout, error handling, and in-memory caching.
|
|
5
|
-
*
|
|
6
|
-
* @function
|
|
7
|
-
* @param {Object} params - The parameters for fetching video data.
|
|
8
|
-
* @param {string} [params.projectId] - The project ID required for API calls.
|
|
9
|
-
* @param {string} [params.videoId] - The video ID to fetch a single video's playback URL.
|
|
10
|
-
* @param {string} [params.playlistId] - The playlist ID to fetch a list of videos.
|
|
11
|
-
* @param {string} [params.videoUrl] - The direct video URL (skips API call if provided).
|
|
12
|
-
* @param {string} [params.apiKey] - The API key for authentication (optional, defaults to environment variable).
|
|
13
|
-
* @returns {VideoDataResult} - Result object with URL, playlist, loading and error states
|
|
14
|
-
*/
|
|
15
|
-
export declare const useVideoData: ({ projectId, videoId, playlistId, videoUrl, apiKey, }: {
|
|
16
|
-
projectId?: string;
|
|
17
|
-
videoId?: string;
|
|
18
|
-
playlistId?: string;
|
|
19
|
-
videoUrl?: string;
|
|
20
|
-
apiKey?: string;
|
|
21
|
-
}) => VideoDataResult;
|
package/dist/index.d.ts
DELETED
|
@@ -1,303 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Interface describing the advertising configuration options for the VP Player.
|
|
3
|
-
*
|
|
4
|
-
* @interface
|
|
5
|
-
* @see {@link https://vp.gjirafa.tech/documentation/docs/web-player/setup-the-player/advertising}
|
|
6
|
-
*/
|
|
7
|
-
export interface VPPlayerAdsConfig {
|
|
8
|
-
skipAd?: {
|
|
9
|
-
state: boolean;
|
|
10
|
-
skipFrom: number;
|
|
11
|
-
};
|
|
12
|
-
vmap?: string;
|
|
13
|
-
VPAIDmode?: string;
|
|
14
|
-
enableProgrammability?: boolean;
|
|
15
|
-
functions?: Array<{
|
|
16
|
-
isDynamicKey: boolean;
|
|
17
|
-
isDynamicValue: boolean;
|
|
18
|
-
key: string;
|
|
19
|
-
order: number;
|
|
20
|
-
value: string;
|
|
21
|
-
}>;
|
|
22
|
-
bidding?: boolean;
|
|
23
|
-
afterMidrollBacktrack?: {
|
|
24
|
-
state: boolean;
|
|
25
|
-
seconds: number;
|
|
26
|
-
};
|
|
27
|
-
adBreaks?: Array<{
|
|
28
|
-
adTagUrl: string[];
|
|
29
|
-
breakType?: 'preroll' | 'midroll' | 'postroll';
|
|
30
|
-
breakTimingType?: 'time' | 'percentage' | 'playlist';
|
|
31
|
-
breakTimingValue?: number;
|
|
32
|
-
schedule?: {
|
|
33
|
-
type?: 'CUSTOM' | 'RECURRING';
|
|
34
|
-
ranges?: Array<{
|
|
35
|
-
startTime?: number;
|
|
36
|
-
endTime?: number;
|
|
37
|
-
count?: number;
|
|
38
|
-
breaks?: number[];
|
|
39
|
-
}>;
|
|
40
|
-
algorithm?: 'PASSIVE' | 'AGGRESSIVE' | 'SIMILAR_DISTANCE' | 'CUSTOM';
|
|
41
|
-
protectFirst?: number;
|
|
42
|
-
protectLast?: number;
|
|
43
|
-
occurEvery?: number;
|
|
44
|
-
liveCount?: number;
|
|
45
|
-
};
|
|
46
|
-
}>;
|
|
47
|
-
bidders?: Array<{
|
|
48
|
-
name: string;
|
|
49
|
-
params?: Array<{
|
|
50
|
-
paramName?: string;
|
|
51
|
-
paramType?: string;
|
|
52
|
-
paramValue?: string;
|
|
53
|
-
}>;
|
|
54
|
-
}>;
|
|
55
|
-
adsRequireInteraction?: boolean;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Interface defining the configuration options for the VP Player.
|
|
59
|
-
*
|
|
60
|
-
* @interface
|
|
61
|
-
* @see {@link https://vp.gjirafa.tech/documentation/docs/web-player/setup-the-player/configuration}
|
|
62
|
-
* @see {@link https://vp.gjirafa.tech/documentation/docs/web-player/setup-the-player/playing}
|
|
63
|
-
* @see {@link https://vp.gjirafa.tech/documentation/docs/web-player/setup-the-player/advertising}
|
|
64
|
-
* @see {@link https://vp.gjirafa.tech/documentation/docs/web-player/setup-the-player/styling}
|
|
65
|
-
* @see {@link https://vp.gjirafa.tech/documentation/docs/web-player/setup-the-player/localization}
|
|
66
|
-
* @see {@link https://vp.gjirafa.tech/documentation/docs/web-player/setup-the-player/full-configuration}
|
|
67
|
-
*/
|
|
68
|
-
export interface VPPlayerConfig {
|
|
69
|
-
projectId?: string;
|
|
70
|
-
video: {
|
|
71
|
-
ads?: VPPlayerAdsConfig;
|
|
72
|
-
advertising?: boolean;
|
|
73
|
-
file?: string;
|
|
74
|
-
title?: string;
|
|
75
|
-
description?: string;
|
|
76
|
-
publishDate?: string;
|
|
77
|
-
duration?: number;
|
|
78
|
-
thumbnail?: string;
|
|
79
|
-
filmstrip?: string;
|
|
80
|
-
author?: string;
|
|
81
|
-
source?: string;
|
|
82
|
-
tags?: string[];
|
|
83
|
-
playlist?: {
|
|
84
|
-
state: boolean;
|
|
85
|
-
playlistVideoIndex: number;
|
|
86
|
-
videos: Array<{
|
|
87
|
-
videoId: string;
|
|
88
|
-
title: string;
|
|
89
|
-
thumbnailUrl?: string;
|
|
90
|
-
duration?: number;
|
|
91
|
-
file?: string;
|
|
92
|
-
}>;
|
|
93
|
-
};
|
|
94
|
-
};
|
|
95
|
-
config: {
|
|
96
|
-
adAnnouncement?: {
|
|
97
|
-
state?: boolean;
|
|
98
|
-
timeBeforeAd?: number;
|
|
99
|
-
};
|
|
100
|
-
autostartOnLoad?: {
|
|
101
|
-
state?: boolean;
|
|
102
|
-
onMobile?: boolean;
|
|
103
|
-
onData?: boolean;
|
|
104
|
-
};
|
|
105
|
-
adsRequireInteraction?: boolean;
|
|
106
|
-
autoplay?: boolean;
|
|
107
|
-
pauseOtherVideos?: boolean;
|
|
108
|
-
focusOnAutostart?: boolean;
|
|
109
|
-
muted?: boolean;
|
|
110
|
-
loop?: boolean;
|
|
111
|
-
size?: {
|
|
112
|
-
sizeType?: string;
|
|
113
|
-
aspectRatio?: string;
|
|
114
|
-
width?: number | string;
|
|
115
|
-
height?: number | string;
|
|
116
|
-
};
|
|
117
|
-
showRelatedOnPause?: {
|
|
118
|
-
state?: boolean;
|
|
119
|
-
onMobile?: boolean;
|
|
120
|
-
from?: number;
|
|
121
|
-
};
|
|
122
|
-
float?: {
|
|
123
|
-
state: boolean;
|
|
124
|
-
onMobile: boolean;
|
|
125
|
-
position: string;
|
|
126
|
-
dismissible: boolean;
|
|
127
|
-
requiresInteraction: boolean;
|
|
128
|
-
toVideoThreshold: number;
|
|
129
|
-
toFloatThreshold: number;
|
|
130
|
-
style: {
|
|
131
|
-
width: number;
|
|
132
|
-
border: string;
|
|
133
|
-
};
|
|
134
|
-
};
|
|
135
|
-
controls?: {
|
|
136
|
-
theaterButton?: boolean;
|
|
137
|
-
settingsButton?: boolean;
|
|
138
|
-
chromecastButton?: boolean;
|
|
139
|
-
nextButton?: boolean;
|
|
140
|
-
fullscreenButton?: boolean;
|
|
141
|
-
airplayButton?: boolean;
|
|
142
|
-
bigPlayButton?: boolean;
|
|
143
|
-
autopausePlayButton?: boolean;
|
|
144
|
-
pictureInPictureButton?: boolean;
|
|
145
|
-
relatedButton?: boolean;
|
|
146
|
-
volumeButton?: boolean;
|
|
147
|
-
shareButton?: boolean;
|
|
148
|
-
};
|
|
149
|
-
logo?: {
|
|
150
|
-
state?: boolean;
|
|
151
|
-
file?: string;
|
|
152
|
-
position?: string;
|
|
153
|
-
defaultOpacity?: number;
|
|
154
|
-
inactiveOpacity?: number;
|
|
155
|
-
onClickURL?: string;
|
|
156
|
-
};
|
|
157
|
-
skin?: {
|
|
158
|
-
controlBar?: {
|
|
159
|
-
background?: string;
|
|
160
|
-
spread?: "solid" | "gradient";
|
|
161
|
-
gradientMidPoint?: number;
|
|
162
|
-
text?: string;
|
|
163
|
-
icons?: {
|
|
164
|
-
default?: string;
|
|
165
|
-
hover?: string;
|
|
166
|
-
};
|
|
167
|
-
timeslider?: {
|
|
168
|
-
progress?: string;
|
|
169
|
-
rail?: string;
|
|
170
|
-
buffer?: string;
|
|
171
|
-
dragger?: string;
|
|
172
|
-
};
|
|
173
|
-
timesliderOnAd?: {
|
|
174
|
-
progress?: string;
|
|
175
|
-
rail?: string;
|
|
176
|
-
buffer?: string;
|
|
177
|
-
dragger?: string;
|
|
178
|
-
};
|
|
179
|
-
volume?: {
|
|
180
|
-
dragger?: string;
|
|
181
|
-
progress?: string;
|
|
182
|
-
rail?: string;
|
|
183
|
-
notifier?: string;
|
|
184
|
-
};
|
|
185
|
-
};
|
|
186
|
-
menus?: {
|
|
187
|
-
background?: {
|
|
188
|
-
default?: string;
|
|
189
|
-
hover?: string;
|
|
190
|
-
};
|
|
191
|
-
links?: {
|
|
192
|
-
default?: string;
|
|
193
|
-
hover?: string;
|
|
194
|
-
};
|
|
195
|
-
autoplay?: {
|
|
196
|
-
autoplayOn?: string;
|
|
197
|
-
autoplayOff?: string;
|
|
198
|
-
};
|
|
199
|
-
};
|
|
200
|
-
nextVideo?: {
|
|
201
|
-
background?: string;
|
|
202
|
-
text?: string;
|
|
203
|
-
timeslider?: {
|
|
204
|
-
rail?: string;
|
|
205
|
-
progress?: string;
|
|
206
|
-
};
|
|
207
|
-
icons?: {
|
|
208
|
-
play?: {
|
|
209
|
-
default?: string;
|
|
210
|
-
hover?: string;
|
|
211
|
-
};
|
|
212
|
-
close?: string;
|
|
213
|
-
};
|
|
214
|
-
};
|
|
215
|
-
playlist?: {
|
|
216
|
-
background?: string;
|
|
217
|
-
text?: string;
|
|
218
|
-
icons?: {
|
|
219
|
-
arrows?: {
|
|
220
|
-
active?: string;
|
|
221
|
-
inactive?: string;
|
|
222
|
-
};
|
|
223
|
-
close?: string;
|
|
224
|
-
};
|
|
225
|
-
card?: {
|
|
226
|
-
background?: string;
|
|
227
|
-
title?: string;
|
|
228
|
-
duration?: {
|
|
229
|
-
text?: string;
|
|
230
|
-
background?: string;
|
|
231
|
-
};
|
|
232
|
-
icons?: {
|
|
233
|
-
play?: {
|
|
234
|
-
default?: string;
|
|
235
|
-
hover?: string;
|
|
236
|
-
};
|
|
237
|
-
};
|
|
238
|
-
};
|
|
239
|
-
};
|
|
240
|
-
};
|
|
241
|
-
lang?: {
|
|
242
|
-
locale?: string;
|
|
243
|
-
controls?: {
|
|
244
|
-
play?: string;
|
|
245
|
-
pause?: string;
|
|
246
|
-
next?: string;
|
|
247
|
-
replay?: string;
|
|
248
|
-
volume?: string;
|
|
249
|
-
mute?: string;
|
|
250
|
-
unmute?: string;
|
|
251
|
-
settings?: string;
|
|
252
|
-
theater?: string;
|
|
253
|
-
fullscreen?: string;
|
|
254
|
-
chromecast?: string;
|
|
255
|
-
airplay?: string;
|
|
256
|
-
pictureInPicture?: string;
|
|
257
|
-
related?: string;
|
|
258
|
-
skipIntro?: string;
|
|
259
|
-
skipAd?: string;
|
|
260
|
-
playlistTitle?: string;
|
|
261
|
-
upNext?: string;
|
|
262
|
-
live?: string;
|
|
263
|
-
continueAfterPause?: string;
|
|
264
|
-
};
|
|
265
|
-
settings?: {
|
|
266
|
-
quality?: string;
|
|
267
|
-
subtitles?: string;
|
|
268
|
-
autoplay?: string;
|
|
269
|
-
playbackRate?: string;
|
|
270
|
-
auto?: string;
|
|
271
|
-
off?: string;
|
|
272
|
-
normal?: string;
|
|
273
|
-
share?: string;
|
|
274
|
-
};
|
|
275
|
-
ads?: {
|
|
276
|
-
ad?: string;
|
|
277
|
-
skip?: string;
|
|
278
|
-
skipIn?: string;
|
|
279
|
-
visit?: string;
|
|
280
|
-
info?: string;
|
|
281
|
-
simultaneousAds?: string;
|
|
282
|
-
adAnnouncement?: string;
|
|
283
|
-
};
|
|
284
|
-
messages?: {
|
|
285
|
-
playbackErrorTitle?: string;
|
|
286
|
-
playbackErrorDescription?: string;
|
|
287
|
-
geoBlockedTitle?: string;
|
|
288
|
-
geoBlockedDescription?: string;
|
|
289
|
-
streamInterruptedTitle?: string;
|
|
290
|
-
streamInterruptedDescription?: string;
|
|
291
|
-
};
|
|
292
|
-
};
|
|
293
|
-
ads?: VPPlayerAdsConfig;
|
|
294
|
-
};
|
|
295
|
-
}
|
|
296
|
-
/**
|
|
297
|
-
* Default configuration object for the VP Player.
|
|
298
|
-
*
|
|
299
|
-
* @constant
|
|
300
|
-
* @type {VPPlayerConfig}
|
|
301
|
-
* @see {@link https://vp.gjirafa.tech/documentation/docs/web-player/setup-the-player/configuration}
|
|
302
|
-
*/
|
|
303
|
-
export declare const defaultVPPlayerConfig: VPPlayerConfig;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { VPPlayerConfig } from "./config";
|
|
2
|
-
/**
|
|
3
|
-
* Interface representing an instance of the VP Player.
|
|
4
|
-
*
|
|
5
|
-
* @interface
|
|
6
|
-
*/
|
|
7
|
-
export interface VPPlayerInstance {
|
|
8
|
-
setup: (config: VPPlayerConfig) => void;
|
|
9
|
-
destroy?: () => void;
|
|
10
|
-
play?: () => void;
|
|
11
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { VPPlayerConfig } from "./config";
|
|
2
|
-
/**
|
|
3
|
-
* Interface defining the parameters for configuring the VP Player instance.
|
|
4
|
-
*
|
|
5
|
-
* @interface
|
|
6
|
-
*/
|
|
7
|
-
export interface PlayerParams {
|
|
8
|
-
playerId?: string;
|
|
9
|
-
videoId?: string;
|
|
10
|
-
projectId?: string;
|
|
11
|
-
videoUrl?: string;
|
|
12
|
-
playlistId?: string;
|
|
13
|
-
scriptUrl?: string;
|
|
14
|
-
version?: string | null;
|
|
15
|
-
config?: Partial<VPPlayerConfig>;
|
|
16
|
-
thumbnailUrl?: string;
|
|
17
|
-
isReels?: boolean;
|
|
18
|
-
hiddenClasses?: string[];
|
|
19
|
-
apiKey?: string;
|
|
20
|
-
className?: string;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Interface for the VP Player context, providing methods and state for controlling the player.
|
|
24
|
-
*
|
|
25
|
-
* @interface
|
|
26
|
-
*/
|
|
27
|
-
export interface VPPlayerContextType {
|
|
28
|
-
showPlayer: (params: PlayerParams) => void;
|
|
29
|
-
hidePlayer: () => void;
|
|
30
|
-
isPlayerVisible: boolean;
|
|
31
|
-
playerParams: PlayerParams | null;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Interface defining the properties for the VP Player component.
|
|
35
|
-
*
|
|
36
|
-
* @interface
|
|
37
|
-
*/
|
|
38
|
-
export interface VPPlayerProps {
|
|
39
|
-
playerId: string;
|
|
40
|
-
videoId?: string;
|
|
41
|
-
projectId?: string;
|
|
42
|
-
videoUrl?: string;
|
|
43
|
-
playlistId?: string;
|
|
44
|
-
scriptUrl?: string;
|
|
45
|
-
version?: string | null;
|
|
46
|
-
config?: Partial<VPPlayerConfig>;
|
|
47
|
-
isReels?: boolean;
|
|
48
|
-
thumbnailUrl?: string;
|
|
49
|
-
onClose?: () => void;
|
|
50
|
-
hiddenClasses?: string[];
|
|
51
|
-
apiKey?: string;
|
|
52
|
-
isPlayerVisible?: boolean;
|
|
53
|
-
className?: string;
|
|
54
|
-
}
|
package/dist/main.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "./index.css";
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* API response types for VP Player.
|
|
3
|
-
*
|
|
4
|
-
* @interface VideoApiItem
|
|
5
|
-
* Represents an individual video item in the API response.
|
|
6
|
-
*/
|
|
7
|
-
export interface VideoApiItem {
|
|
8
|
-
mediaId: string;
|
|
9
|
-
playbackUrl: string;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* API response structure for fetching video data.
|
|
13
|
-
*
|
|
14
|
-
* @interface VideoApiResponse
|
|
15
|
-
*/
|
|
16
|
-
export interface VideoApiResponse {
|
|
17
|
-
result: {
|
|
18
|
-
items: VideoApiItem[];
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Represents an item in a video playlist.
|
|
23
|
-
*
|
|
24
|
-
* @interface PlaylistItem
|
|
25
|
-
*/
|
|
26
|
-
export interface PlaylistItem {
|
|
27
|
-
title: string;
|
|
28
|
-
hlsUrl: string;
|
|
29
|
-
thumbnailUrl: string;
|
|
30
|
-
duration: number;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* API response structure for fetching playlist data.
|
|
34
|
-
*
|
|
35
|
-
* @interface PlaylistApiResponse
|
|
36
|
-
*/
|
|
37
|
-
export interface PlaylistApiResponse {
|
|
38
|
-
result: PlaylistItem[];
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Result structure returned by the video data fetching logic.
|
|
42
|
-
*
|
|
43
|
-
* @interface VideoDataResult
|
|
44
|
-
*/
|
|
45
|
-
export interface VideoDataResult {
|
|
46
|
-
fetchedPlaybackUrl: string | null;
|
|
47
|
-
fetchedPlaylist: PlaylistItem[] | null;
|
|
48
|
-
isLoading: boolean;
|
|
49
|
-
error: string | null;
|
|
50
|
-
}
|
package/dist/types/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./api.types";
|
package/dist/utils/index.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { VPPlayerConfig } from "@/interfaces";
|
|
2
|
-
import { PlaylistItem } from "@/types";
|
|
3
|
-
/**
|
|
4
|
-
* Interface for options used in building the VP Player configuration.
|
|
5
|
-
*
|
|
6
|
-
* @interface ConfigBuilderOptions
|
|
7
|
-
*/
|
|
8
|
-
interface ConfigBuilderOptions {
|
|
9
|
-
videoUrl?: string;
|
|
10
|
-
fetchedPlaybackUrl: string | null;
|
|
11
|
-
fetchedPlaylist: PlaylistItem[] | null;
|
|
12
|
-
projectId?: string;
|
|
13
|
-
config?: Partial<VPPlayerConfig>;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Builds the final VP Player configuration based on available data.
|
|
17
|
-
* Handles different data sources in priority order:
|
|
18
|
-
* 1. Direct video URL
|
|
19
|
-
* 2. Single video from API
|
|
20
|
-
* 3. Playlist from API
|
|
21
|
-
* 4. Playlist from config
|
|
22
|
-
*
|
|
23
|
-
* @function
|
|
24
|
-
* @param {ConfigBuilderOptions} options - Options for building the configuration
|
|
25
|
-
* @returns {VPPlayerConfig} - The final configuration object for the player
|
|
26
|
-
* @throws {Error} - Throws error if no valid video source is found
|
|
27
|
-
*/
|
|
28
|
-
export declare const buildVPPlayerConfig: ({ videoUrl, fetchedPlaybackUrl, fetchedPlaylist, projectId, config, }: ConfigBuilderOptions) => VPPlayerConfig;
|
|
29
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Extracts the video ID from a given VP Player script URL.
|
|
3
|
-
*
|
|
4
|
-
* @function
|
|
5
|
-
* @param {string} [scriptUrl] - The script URL containing the video ID.
|
|
6
|
-
* @returns {string | undefined} The extracted video ID, or `undefined` if not found.
|
|
7
|
-
*/
|
|
8
|
-
export declare const extractVideoId: (scriptUrl?: string) => string | undefined;
|