@devix-technologies/react-gjirafa-vp-player 1.0.30 → 1.0.31-beta.1
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 +95 -707
- package/dist/index.d.ts +919 -9
- package/dist/react-gjirafa-vp-player.es.js +1224 -1383
- package/dist/react-gjirafa-vp-player.umd.js +13 -12
- package/package.json +19 -24
- 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 -9
- package/dist/constants/styles.d.ts +0 -11
- package/dist/constants/urls.d.ts +0 -18
- package/dist/constants/vpPlayer.d.ts +0 -47
- package/dist/contexts/VPPlayerContext.d.ts +0 -52
- package/dist/contexts/index.d.ts +0 -1
- package/dist/features/VPPlayer.d.ts +0 -41
- package/dist/features/stories/ads/Ads.stories.d.ts +0 -20
- 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 -38
- package/dist/fixtures/index.d.ts +0 -1
- package/dist/fixtures/playlist.d.ts +0 -11
- package/dist/hooks/index.d.ts +0 -4
- package/dist/hooks/useVPPlayerEvents.d.ts +0 -24
- package/dist/hooks/useVPPlayerLogic.d.ts +0 -22
- package/dist/hooks/useVPPlayerScript.d.ts +0 -13
- package/dist/hooks/useVideoData.d.ts +0 -19
- package/dist/interfaces/config.d.ts +0 -314
- package/dist/interfaces/index.d.ts +0 -3
- package/dist/interfaces/instance.d.ts +0 -73
- package/dist/interfaces/props.d.ts +0 -77
- package/dist/main.d.ts +0 -0
- package/dist/types/api.types.d.ts +0 -81
- package/dist/types/index.d.ts +0 -2
- package/dist/types/playerEvents.types.d.ts +0 -67
- package/dist/utils/index.d.ts +0 -2
- package/dist/utils/vpPlayerConfigBuilder.d.ts +0 -30
- package/dist/utils/vpPlayerUtils.d.ts +0 -8
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,919 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { CurrentVideoData as CurrentVideoData_2 } from '../../../../../../../src/types';
|
|
2
|
+
import { default as default_2 } from 'react';
|
|
3
|
+
import { DetailedHTMLProps } from 'react';
|
|
4
|
+
import { HTMLAttributes } from 'react';
|
|
5
|
+
import { JSX } from 'react/jsx-runtime';
|
|
6
|
+
import { PlayerEventCallbacks as PlayerEventCallbacks_2 } from '../../../../../../../src/types';
|
|
7
|
+
import { PlayerTrackingMetadata as PlayerTrackingMetadata_2 } from '../../../../../../../src/types';
|
|
8
|
+
import { PlaylistItem as PlaylistItem_2 } from '../../../../../../../src/types';
|
|
9
|
+
import { RefObject } from 'react';
|
|
10
|
+
import { StyledComponent } from '@emotion/styled';
|
|
11
|
+
import { Theme } from '@emotion/react';
|
|
12
|
+
import { VPPlayerConfig as VPPlayerConfig_2 } from '../../../../../../../src/interfaces';
|
|
13
|
+
import { VPPlayerConfig as VPPlayerConfig_3 } from '../../../../../../../src/interfaces/config';
|
|
14
|
+
import { VPPlayerInstance as VPPlayerInstance_2 } from '../../../../../../../src/interfaces';
|
|
15
|
+
import { VPPlayerProps as VPPlayerProps_2 } from '../../../../../../../src/interfaces';
|
|
16
|
+
|
|
17
|
+
/** Ad tag URL for linear ads */
|
|
18
|
+
export declare const AD_TAG_LINEAR_URL = "https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%3Dlinear&correlator=";
|
|
19
|
+
|
|
20
|
+
/** Ad tag URL for skippable linear ads */
|
|
21
|
+
export declare const AD_TAG_SKIPPABLE_LINEAR_URL = "https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%3Dskippablelinear&correlator=";
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Base configuration for VP Player with common settings.
|
|
25
|
+
*/
|
|
26
|
+
export declare const baseConfig: Partial<VPPlayerConfig_3>;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Base configuration for ads with common ad settings.
|
|
30
|
+
*/
|
|
31
|
+
export declare const baseConfigWithAds: Partial<VPPlayerConfig_3>;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Base configuration with autoplay enabled.
|
|
35
|
+
*/
|
|
36
|
+
export declare const baseConfigWithAutoplay: Partial<VPPlayerConfig_3>;
|
|
37
|
+
|
|
38
|
+
/** URL for the Big Buck Bunny video */
|
|
39
|
+
export declare const BIG_BUCK_BUNNY_URL = "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4";
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Builds the final VP Player configuration based on available data.
|
|
43
|
+
*
|
|
44
|
+
* For vertical player with playlist, BOTH video.file AND video.playlist are needed.
|
|
45
|
+
* The video.file should contain the URL of the current/first video to play.
|
|
46
|
+
*
|
|
47
|
+
* @function
|
|
48
|
+
* @param {ConfigBuilderOptions} options - Options for building the configuration
|
|
49
|
+
* @returns {VPPlayerConfig} - The final configuration object for the player
|
|
50
|
+
* @throws {Error} - Throws error if no valid video source is found
|
|
51
|
+
*/
|
|
52
|
+
export declare const buildVPPlayerConfig: ({ videoUrl, projectId, config, isVerticalPlayer, pureMode, }: ConfigBuilderOptions) => VPPlayerConfig_2;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Interface for options used in building the VP Player configuration.
|
|
56
|
+
*
|
|
57
|
+
* @interface ConfigBuilderOptions
|
|
58
|
+
*/
|
|
59
|
+
declare interface ConfigBuilderOptions {
|
|
60
|
+
videoUrl?: string;
|
|
61
|
+
projectId?: string;
|
|
62
|
+
config?: Partial<VPPlayerConfig_2>;
|
|
63
|
+
isVerticalPlayer?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* When true, skips all wrapper defaults and passes only minimal config to the SDK.
|
|
66
|
+
* Use this to let the GTech admin panel settings be the source of truth.
|
|
67
|
+
*/
|
|
68
|
+
pureMode?: boolean;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Represents data about the currently playing video.
|
|
73
|
+
* Used in onVideoStarted callback.
|
|
74
|
+
*
|
|
75
|
+
* @interface CurrentVideoData
|
|
76
|
+
*/
|
|
77
|
+
export declare interface CurrentVideoData {
|
|
78
|
+
title?: string;
|
|
79
|
+
file?: string;
|
|
80
|
+
hlsUrl?: string;
|
|
81
|
+
thumbnailUrl?: string;
|
|
82
|
+
duration?: number;
|
|
83
|
+
videoIndex?: number;
|
|
84
|
+
playlistVideoIndex?: number;
|
|
85
|
+
isBackupPlaylist?: boolean;
|
|
86
|
+
videoId?: string;
|
|
87
|
+
mediaId?: string;
|
|
88
|
+
publishDate?: string;
|
|
89
|
+
projectId?: string;
|
|
90
|
+
premium?: boolean;
|
|
91
|
+
author?: string;
|
|
92
|
+
tags?: string[];
|
|
93
|
+
description?: string;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Default configuration object for the VP Player.
|
|
98
|
+
*
|
|
99
|
+
* NOTE: Intentionally minimal defaults to avoid interfering with managed mode.
|
|
100
|
+
* When using videoId + projectId (managed mode), the SDK fetches video details
|
|
101
|
+
* from the backend. Providing empty `file` or `playlist` can break this flow.
|
|
102
|
+
*
|
|
103
|
+
* @constant
|
|
104
|
+
* @type {VPPlayerConfig}
|
|
105
|
+
* @see {@link https://vp.gjirafa.tech/documentation/docs/web-player/setup-the-player/configuration}
|
|
106
|
+
*/
|
|
107
|
+
export declare const defaultVPPlayerConfig: VPPlayerConfig;
|
|
108
|
+
|
|
109
|
+
/** URL for the Elephants Dream video */
|
|
110
|
+
export declare const ELEPHANTS_DREAM_URL = "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4";
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Extracts the video ID from a given VP Player script URL.
|
|
114
|
+
*
|
|
115
|
+
* IMPORTANT: Only extracts from HORIZONTAL player URLs.
|
|
116
|
+
* Vertical player URLs contain a player script ID, NOT a video ID.
|
|
117
|
+
* - Horizontal: ${VP_PLAYER_BASE_URL}/player/{version}/{videoId}.js -> extracts videoId
|
|
118
|
+
* - Vertical: ${VP_PLAYER_BASE_URL}/vertical-player/{scriptId}.js -> returns undefined
|
|
119
|
+
*
|
|
120
|
+
* @function
|
|
121
|
+
* @param {string} [scriptUrl] - The script URL containing the video ID.
|
|
122
|
+
* @returns {string | undefined} The extracted video ID, or `undefined` if not found or if vertical player.
|
|
123
|
+
*/
|
|
124
|
+
export declare const extractVideoId: (scriptUrl?: string) => string | undefined;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Generates an ad configuration for VP Player based on provided parameters.
|
|
128
|
+
* @param breakType - The type of ad break (e.g., "preroll", "postroll", "midroll").
|
|
129
|
+
* @param adTagUrls - Array of ad tag URLs to use for the ad break.
|
|
130
|
+
* @param breakTimingType - The timing type for the ad break (e.g., "time", "percentage", "playlist").
|
|
131
|
+
* @param breakTimingValue - The timing value for the ad break (e.g., 0 for immediate, 2 for playlist index).
|
|
132
|
+
* @returns A partial VPPlayerConfig with the ad configuration.
|
|
133
|
+
*/
|
|
134
|
+
export declare const getAdConfig: (breakType: "preroll" | "postroll" | "midroll", adTagUrls: string[], breakTimingType?: "time" | "percentage" | "playlist", breakTimingValue?: number) => Partial<VPPlayerConfig_3>;
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Styled component for the full-screen overlay when the player is active.
|
|
138
|
+
*
|
|
139
|
+
* @component
|
|
140
|
+
* @param {string} [className] - CSS class name for additional styling.
|
|
141
|
+
*/
|
|
142
|
+
export declare const Overlay: StyledComponent< {
|
|
143
|
+
theme?: Theme;
|
|
144
|
+
as?: React.ElementType;
|
|
145
|
+
} & {
|
|
146
|
+
className?: string;
|
|
147
|
+
}, DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
148
|
+
|
|
149
|
+
/** URL for the Pexels thumbnail */
|
|
150
|
+
export declare const PEXELS_THUMBNAIL_URL = "https://images.pexels.com/videos/4678261/pexels-photo-4678261.jpeg?auto=compress&cs=tinysrgb&w=600";
|
|
151
|
+
|
|
152
|
+
/** URL for the Pexels vertical video */
|
|
153
|
+
export declare const PEXELS_VERTICAL_VIDEO_URL = "https://videos.pexels.com/video-files/4678261/4678261-hd_1080_1920_25fps.mp4";
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Styled component for the video player container.
|
|
157
|
+
*
|
|
158
|
+
* @component
|
|
159
|
+
* @param {string} [width] - The width of the player (default: "100%").
|
|
160
|
+
* @param {string} [height] - The height of the player (default: "100%").
|
|
161
|
+
* @param {string[]} [$hiddenClasses] - CSS class names to hide elements inside the player.
|
|
162
|
+
* @param {string} [className] - CSS class name for additional styling.
|
|
163
|
+
*/
|
|
164
|
+
export declare const PlayerContainer: StyledComponent< {
|
|
165
|
+
theme?: Theme;
|
|
166
|
+
as?: React.ElementType;
|
|
167
|
+
} & {
|
|
168
|
+
width?: string;
|
|
169
|
+
height?: string;
|
|
170
|
+
$hiddenClasses?: string[];
|
|
171
|
+
className?: string;
|
|
172
|
+
}, DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Callback function type for player events
|
|
176
|
+
* Accepts event name (PlayerEventType) and optionally currentPosition for progress events
|
|
177
|
+
*/
|
|
178
|
+
export declare type PlayerEventCallback = (event: PlayerEventType, currentPosition?: number) => void;
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Individual event callbacks
|
|
182
|
+
* Each callback accepts only the event name (PlayerEventType)
|
|
183
|
+
*/
|
|
184
|
+
export declare interface PlayerEventCallbacks {
|
|
185
|
+
onPlayerStart?: (event: PlayerEventType) => void;
|
|
186
|
+
onPlayerPlay?: (event: PlayerEventType) => void;
|
|
187
|
+
onPlayerPause?: (event: PlayerEventType) => void;
|
|
188
|
+
onPlayerResume?: (event: PlayerEventType) => void;
|
|
189
|
+
onPlayerEnd?: (event: PlayerEventType) => void;
|
|
190
|
+
onPlayerProgressEvery10Seconds?: (event: PlayerEventType, currentPosition: number) => void;
|
|
191
|
+
onPlayerProgressAt20Seconds?: (event: PlayerEventType, currentPosition: number) => void;
|
|
192
|
+
onPlayerQuartile25?: (event: PlayerEventType, currentPosition: number) => void;
|
|
193
|
+
onPlayerQuartile50?: (event: PlayerEventType, currentPosition: number) => void;
|
|
194
|
+
onPlayerQuartile75?: (event: PlayerEventType, currentPosition: number) => void;
|
|
195
|
+
onPlayerNext?: (event: PlayerEventType) => void;
|
|
196
|
+
onPlayerPrevious?: (event: PlayerEventType) => void;
|
|
197
|
+
/**
|
|
198
|
+
* Universal callback for all events - called in addition to specific callbacks
|
|
199
|
+
* Accepts event name (PlayerEventType) and optionally currentPosition for progress events
|
|
200
|
+
*/
|
|
201
|
+
onPlayerEvent?: PlayerEventCallback;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Player event data structure
|
|
206
|
+
*/
|
|
207
|
+
export declare interface PlayerEventData {
|
|
208
|
+
event: PlayerEventType;
|
|
209
|
+
player: PlayerObject;
|
|
210
|
+
_clear?: boolean;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Player event types that can be tracked
|
|
215
|
+
*/
|
|
216
|
+
export declare type PlayerEventType = "player_start" | "player_play" | "player_pause" | "player_resume" | "player_end" | "player_progress_every_10_seconds" | "player_progress_at_20_seconds" | "player_quartile_25" | "player_quartile_50" | "player_quartile_75" | "player_next" | "player_previous";
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Player object structure for analytics
|
|
220
|
+
*/
|
|
221
|
+
export declare interface PlayerObject {
|
|
222
|
+
videoId?: string;
|
|
223
|
+
title?: string;
|
|
224
|
+
categoryName?: string;
|
|
225
|
+
publishedDate?: string;
|
|
226
|
+
isPremium?: boolean;
|
|
227
|
+
tags?: string[];
|
|
228
|
+
isReels?: boolean;
|
|
229
|
+
currentPosition?: number;
|
|
230
|
+
duration?: number;
|
|
231
|
+
progress?: number;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Interface defining the parameters for configuring the VP Player instance.
|
|
236
|
+
*
|
|
237
|
+
* @interface
|
|
238
|
+
*/
|
|
239
|
+
export declare interface PlayerParams {
|
|
240
|
+
playerId: string;
|
|
241
|
+
config?: Partial<VPPlayerConfig>;
|
|
242
|
+
videoId?: string;
|
|
243
|
+
projectId?: string;
|
|
244
|
+
videoUrl?: string;
|
|
245
|
+
playlistId?: string;
|
|
246
|
+
scriptUrl?: string;
|
|
247
|
+
version?: string | null;
|
|
248
|
+
thumbnailUrl?: string;
|
|
249
|
+
isReels?: boolean;
|
|
250
|
+
hiddenClasses?: string[];
|
|
251
|
+
className?: string;
|
|
252
|
+
/**
|
|
253
|
+
* When true (default), skips all wrapper defaults and passes only minimal config to the SDK.
|
|
254
|
+
* This lets the GTech admin panel settings be the source of truth for
|
|
255
|
+
* controls, autoplay, muted, size, and other configuration.
|
|
256
|
+
* Set to false to use legacy behavior with wrapper defaults.
|
|
257
|
+
* @default true
|
|
258
|
+
*/
|
|
259
|
+
pureMode?: boolean;
|
|
260
|
+
onPlaylistData?: (videos: PlaylistItem_2[]) => void;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Interface defining the parameters for initializing the VPPlayer.
|
|
265
|
+
*
|
|
266
|
+
* @interface PlayerParams
|
|
267
|
+
*/
|
|
268
|
+
declare interface PlayerParams_2 {
|
|
269
|
+
playerId?: string;
|
|
270
|
+
videoId?: string;
|
|
271
|
+
projectId?: string;
|
|
272
|
+
videoUrl?: string;
|
|
273
|
+
playlistId?: string;
|
|
274
|
+
scriptUrl?: string;
|
|
275
|
+
version?: string | null;
|
|
276
|
+
config?: VPPlayerProps_2["config"];
|
|
277
|
+
thumbnailUrl?: string;
|
|
278
|
+
isReels?: boolean;
|
|
279
|
+
hiddenClasses?: string[];
|
|
280
|
+
className?: string;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* Tracking metadata for analytics (available in v1.0.23+)
|
|
285
|
+
*/
|
|
286
|
+
export declare interface PlayerTrackingMetadata {
|
|
287
|
+
videoId: string;
|
|
288
|
+
title: string;
|
|
289
|
+
categoryName?: string;
|
|
290
|
+
publishedDate?: string;
|
|
291
|
+
isPremium?: boolean;
|
|
292
|
+
tags?: string[];
|
|
293
|
+
isReels?: boolean;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* Styled wrapper for the player, adjusting its size based on viewport width.
|
|
298
|
+
*
|
|
299
|
+
* @component
|
|
300
|
+
* @param {string} [className] - CSS class name for additional styling.
|
|
301
|
+
*/
|
|
302
|
+
export declare const PlayerWrapper: StyledComponent< {
|
|
303
|
+
theme?: Theme;
|
|
304
|
+
as?: React.ElementType;
|
|
305
|
+
} & {
|
|
306
|
+
className?: string;
|
|
307
|
+
}, DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* API response structure for fetching playlist data.
|
|
311
|
+
*
|
|
312
|
+
* @interface PlaylistApiResponse
|
|
313
|
+
*/
|
|
314
|
+
export declare interface PlaylistApiResponse {
|
|
315
|
+
result: PlaylistItem[];
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* Represents an item in a video playlist.
|
|
320
|
+
*
|
|
321
|
+
* @interface PlaylistItem
|
|
322
|
+
*/
|
|
323
|
+
export declare interface PlaylistItem {
|
|
324
|
+
mediaId: string;
|
|
325
|
+
videoId?: string;
|
|
326
|
+
title: string;
|
|
327
|
+
description?: string;
|
|
328
|
+
hlsUrl: string;
|
|
329
|
+
playbackUrl?: string;
|
|
330
|
+
file?: string;
|
|
331
|
+
thumbnailUrl: string;
|
|
332
|
+
duration: number;
|
|
333
|
+
durationString?: string;
|
|
334
|
+
isBackupPlaylist?: boolean;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* Hook for accessing the VPPlayer context.
|
|
339
|
+
*
|
|
340
|
+
* @function
|
|
341
|
+
* @throws {Error} If used outside of the VPPlayerProvider.
|
|
342
|
+
* @returns {VPPlayerContextType} The VPPlayer context.
|
|
343
|
+
*/
|
|
344
|
+
export declare const useVPPlayer: () => VPPlayerContextType_2;
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Custom hook to manage VP Player logic.
|
|
348
|
+
* Uses native SDK events instead of manual progress tracking.
|
|
349
|
+
*/
|
|
350
|
+
export declare const useVPPlayerLogic: ({ playerId, videoId: propVideoId, version, videoUrl, projectId, playlistId, scriptUrl, config, isReels, pureMode, onPlaylistData, onVideoStarted, onPlayerStart, onPlayerPlay, onPlayerPause, onPlayerResume, onPlayerEnd, onPlayerProgressEvery10Seconds, onPlayerProgressAt20Seconds, onPlayerQuartile25, onPlayerQuartile50, onPlayerQuartile75, onPlayerNext, onPlayerPrevious, onPlayerEvent, }: VPPlayerProps_2) => {
|
|
351
|
+
playerRef: RefObject<HTMLDivElement | null>;
|
|
352
|
+
playerInstanceRef: RefObject<VPPlayerInstance_2 | null>;
|
|
353
|
+
isScriptLoaded: boolean;
|
|
354
|
+
isLoading: boolean;
|
|
355
|
+
error: string | null;
|
|
356
|
+
generatedPlayerId: string;
|
|
357
|
+
};
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* Custom hook to dynamically load the VP Player script into the document.
|
|
361
|
+
* It ensures that the script is only loaded once and provides a loading state.
|
|
362
|
+
*
|
|
363
|
+
* @function
|
|
364
|
+
* @param {string | null} [version] - The version of the VP Player script to load (defaults to "latest").
|
|
365
|
+
* @param {string} [scriptUrl] - Custom script URL (if provided, it overrides the version-based URL).
|
|
366
|
+
* @returns {{ isLoaded: boolean; error: string | null }} Indicates load success and any error message.
|
|
367
|
+
*/
|
|
368
|
+
export declare const useVPPlayerScript: (version?: string | null, scriptUrl?: string) => {
|
|
369
|
+
isLoaded: boolean;
|
|
370
|
+
error: string | null;
|
|
371
|
+
};
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* API response types for VP Player.
|
|
375
|
+
*
|
|
376
|
+
* @interface VideoApiItem
|
|
377
|
+
* Represents an individual video item in the API response.
|
|
378
|
+
*/
|
|
379
|
+
export declare interface VideoApiItem {
|
|
380
|
+
mediaId: string;
|
|
381
|
+
playbackUrl: string;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* API response structure for fetching video data.
|
|
386
|
+
*
|
|
387
|
+
* @interface VideoApiResponse
|
|
388
|
+
*/
|
|
389
|
+
export declare interface VideoApiResponse {
|
|
390
|
+
result: {
|
|
391
|
+
items: VideoApiItem[];
|
|
392
|
+
};
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* Result structure returned by the video data fetching logic.
|
|
397
|
+
*
|
|
398
|
+
* @interface VideoDataResult
|
|
399
|
+
*/
|
|
400
|
+
export declare interface VideoDataResult {
|
|
401
|
+
fetchedPlaybackUrl: string | null;
|
|
402
|
+
fetchedPlaylist: PlaylistItem[] | null;
|
|
403
|
+
isLoading: boolean;
|
|
404
|
+
error: string | null;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
/**
|
|
408
|
+
* Video Player Component for rendering a video player with overlay and responsive behavior.
|
|
409
|
+
* Handles initialization of the player and displays loading/error states.
|
|
410
|
+
*
|
|
411
|
+
* @function
|
|
412
|
+
* @param {VPPlayerProps} props - The properties for configuring the video player.
|
|
413
|
+
* @param {string} props.playerId - Unique identifier for the player instance.
|
|
414
|
+
* @param {string} [props.videoId] - ID of the video to be played.
|
|
415
|
+
* @param {string} [props.version] - Version of the player.
|
|
416
|
+
* @param {string} [props.videoUrl] - Direct video URL (bypasses API calls).
|
|
417
|
+
* @param {string} [props.projectId] - Project ID associated with the video.
|
|
418
|
+
* @param {string} [props.playlistId] - Playlist ID if playing a collection of videos.
|
|
419
|
+
* @param {string} [props.scriptUrl] - URL of the video player script.
|
|
420
|
+
* @param {object} [props.config={}] - Configuration settings for the player.
|
|
421
|
+
* @param {boolean} [props.isReels=false] - Determines if the player should behave as a short-video reel.
|
|
422
|
+
* @param {string[]} [props.hiddenClasses=[]] - CSS classes to hide player elements.
|
|
423
|
+
* @param {function} [props.onClose] - Callback triggered when the player is closed.
|
|
424
|
+
* @param {boolean} [props.isPlayerVisible=false] - Controls the initial visibility of the player.
|
|
425
|
+
* @param {string} [props.className] - CSS class name for additional styling.
|
|
426
|
+
* @param {function} [props.onPlaylistData] - Callback triggered when the playlist data is loaded.
|
|
427
|
+
* @param {function} [props.onVideoStarted] - Callback triggered when the video starts playing.
|
|
428
|
+
* @param {object} [props.trackingMetadata] - Video metadata for tracking/analytics callbacks.
|
|
429
|
+
* @param {function} [props.onPlayerStart] - Callback triggered when the player starts playing.
|
|
430
|
+
* @param {function} [props.onPlayerPlay] - Callback triggered when the player plays.
|
|
431
|
+
* @param {function} [props.onPlayerPause] - Callback triggered when the player pauses.
|
|
432
|
+
* @param {function} [props.onPlayerResume] - Callback triggered when the player resumes.
|
|
433
|
+
* @param {function} [props.onPlayerEnd] - Callback triggered when the player ends.
|
|
434
|
+
* @param {function} [props.onPlayerProgressEvery10Seconds] - Callback triggered every 10 seconds.
|
|
435
|
+
* @param {function} [props.onPlayerProgressAt20Seconds] - Callback triggered at 20 seconds.
|
|
436
|
+
* @param {function} [props.onPlayerQuartile25] - Callback triggered at 25% quartile.
|
|
437
|
+
* @param {function} [props.onPlayerQuartile50] - Callback triggered at 50% quartile.
|
|
438
|
+
* @param {function} [props.onPlayerQuartile75] - Callback triggered at 75% quartile.
|
|
439
|
+
* @param {function} [props.onPlayerNext] - Callback triggered when the player goes to the next video.
|
|
440
|
+
* @param {function} [props.onPlayerEvent] - Callback triggered for all events.
|
|
441
|
+
* @param {boolean} [props.pureMode=true] - When true (default), skips wrapper defaults and uses GTech admin config.
|
|
442
|
+
* @returns {JSX.Element} The rendered video player component.
|
|
443
|
+
*/
|
|
444
|
+
export declare const VPPlayer: ({ playerId, videoId, version, videoUrl, projectId, playlistId, scriptUrl, config, isReels, pureMode, hiddenClasses, onClose, className, onPlaylistData, onVideoStarted, trackingMetadata, onPlayerStart, onPlayerPlay, onPlayerPause, onPlayerResume, onPlayerEnd, onPlayerProgressEvery10Seconds, onPlayerProgressAt20Seconds, onPlayerQuartile25, onPlayerQuartile50, onPlayerQuartile75, onPlayerNext, onPlayerPrevious, onPlayerEvent, }: VPPlayerProps_2 & {
|
|
445
|
+
className?: string;
|
|
446
|
+
}) => JSX.Element;
|
|
447
|
+
|
|
448
|
+
/**
|
|
449
|
+
* Interface describing the advertising configuration options for the VP Player.
|
|
450
|
+
*
|
|
451
|
+
* @interface
|
|
452
|
+
* @see {@link https://vp.gjirafa.tech/documentation/docs/web-player/setup-the-player/advertising}
|
|
453
|
+
*/
|
|
454
|
+
export declare interface VPPlayerAdsConfig {
|
|
455
|
+
skipAd?: {
|
|
456
|
+
state: boolean;
|
|
457
|
+
skipFrom: number;
|
|
458
|
+
};
|
|
459
|
+
vmap?: string;
|
|
460
|
+
VPAIDmode?: string;
|
|
461
|
+
enableProgrammability?: boolean;
|
|
462
|
+
functions?: Array<{
|
|
463
|
+
isDynamicKey: boolean;
|
|
464
|
+
isDynamicValue: boolean;
|
|
465
|
+
key: string;
|
|
466
|
+
order: number;
|
|
467
|
+
value: string;
|
|
468
|
+
}>;
|
|
469
|
+
bidding?: boolean;
|
|
470
|
+
afterMidrollBacktrack?: {
|
|
471
|
+
state: boolean;
|
|
472
|
+
seconds: number;
|
|
473
|
+
};
|
|
474
|
+
adBreaks?: Array<{
|
|
475
|
+
adTagUrl: string[];
|
|
476
|
+
breakType?: 'preroll' | 'midroll' | 'postroll';
|
|
477
|
+
breakTimingType?: 'time' | 'percentage' | 'playlist';
|
|
478
|
+
breakTimingValue?: number;
|
|
479
|
+
schedule?: {
|
|
480
|
+
type?: 'CUSTOM' | 'RECURRING';
|
|
481
|
+
ranges?: Array<{
|
|
482
|
+
startTime?: number;
|
|
483
|
+
endTime?: number;
|
|
484
|
+
count?: number;
|
|
485
|
+
breaks?: number[];
|
|
486
|
+
}>;
|
|
487
|
+
algorithm?: 'PASSIVE' | 'AGGRESSIVE' | 'SIMILAR_DISTANCE' | 'CUSTOM';
|
|
488
|
+
protectFirst?: number;
|
|
489
|
+
protectLast?: number;
|
|
490
|
+
occurEvery?: number;
|
|
491
|
+
liveCount?: number;
|
|
492
|
+
};
|
|
493
|
+
}>;
|
|
494
|
+
bidders?: Array<{
|
|
495
|
+
name: string;
|
|
496
|
+
params?: Array<{
|
|
497
|
+
paramName?: string;
|
|
498
|
+
paramType?: string;
|
|
499
|
+
paramValue?: string;
|
|
500
|
+
}>;
|
|
501
|
+
}>;
|
|
502
|
+
adsRequireInteraction?: boolean;
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
/**
|
|
506
|
+
* Interface defining the configuration options for the VP Player.
|
|
507
|
+
*
|
|
508
|
+
* @interface
|
|
509
|
+
* @see {@link https://vp.gjirafa.tech/documentation/docs/web-player/setup-the-player/configuration}
|
|
510
|
+
* @see {@link https://vp.gjirafa.tech/documentation/docs/web-player/setup-the-player/playing}
|
|
511
|
+
* @see {@link https://vp.gjirafa.tech/documentation/docs/web-player/setup-the-player/advertising}
|
|
512
|
+
* @see {@link https://vp.gjirafa.tech/documentation/docs/web-player/setup-the-player/styling}
|
|
513
|
+
* @see {@link https://vp.gjirafa.tech/documentation/docs/web-player/setup-the-player/localization}
|
|
514
|
+
* @see {@link https://vp.gjirafa.tech/documentation/docs/web-player/setup-the-player/full-configuration}
|
|
515
|
+
*/
|
|
516
|
+
export declare interface VPPlayerConfig {
|
|
517
|
+
projectId?: string;
|
|
518
|
+
videoId?: string;
|
|
519
|
+
categoryName?: string;
|
|
520
|
+
gemiusIdentifier?: string;
|
|
521
|
+
typology?: string;
|
|
522
|
+
video: {
|
|
523
|
+
videoId?: string;
|
|
524
|
+
ads?: VPPlayerAdsConfig;
|
|
525
|
+
advertising?: boolean;
|
|
526
|
+
videoLocking?: {
|
|
527
|
+
isEnabled: boolean;
|
|
528
|
+
type: string;
|
|
529
|
+
value: number;
|
|
530
|
+
};
|
|
531
|
+
file?: string;
|
|
532
|
+
title?: string;
|
|
533
|
+
description?: string;
|
|
534
|
+
publishDate?: string;
|
|
535
|
+
duration?: number;
|
|
536
|
+
preload?: string;
|
|
537
|
+
thumbnail?: string;
|
|
538
|
+
filmstrip?: string;
|
|
539
|
+
author?: string;
|
|
540
|
+
source?: string;
|
|
541
|
+
tags?: string[];
|
|
542
|
+
tracks?: Array<{
|
|
543
|
+
file: string;
|
|
544
|
+
label: string;
|
|
545
|
+
kind: string;
|
|
546
|
+
default?: boolean;
|
|
547
|
+
}>;
|
|
548
|
+
playlist?: {
|
|
549
|
+
state?: boolean;
|
|
550
|
+
playlistId?: string;
|
|
551
|
+
playlistVideoIndex?: number;
|
|
552
|
+
videos?: Array<{
|
|
553
|
+
videoId: string;
|
|
554
|
+
title: string;
|
|
555
|
+
thumbnailUrl?: string;
|
|
556
|
+
duration?: number;
|
|
557
|
+
file?: string;
|
|
558
|
+
hlsUrl?: string;
|
|
559
|
+
}>;
|
|
560
|
+
};
|
|
561
|
+
};
|
|
562
|
+
config: {
|
|
563
|
+
adAnnouncement?: {
|
|
564
|
+
state?: boolean;
|
|
565
|
+
timeBeforeAd?: number;
|
|
566
|
+
};
|
|
567
|
+
autostartOnLoad?: {
|
|
568
|
+
state?: boolean;
|
|
569
|
+
onMobile?: boolean;
|
|
570
|
+
onData?: boolean;
|
|
571
|
+
};
|
|
572
|
+
adsRequireInteraction?: boolean;
|
|
573
|
+
autoplay?: boolean;
|
|
574
|
+
pauseOtherVideos?: boolean;
|
|
575
|
+
focusOnAutostart?: boolean;
|
|
576
|
+
muted?: boolean;
|
|
577
|
+
loop?: boolean;
|
|
578
|
+
size?: {
|
|
579
|
+
sizeType?: string;
|
|
580
|
+
aspectRatio?: string;
|
|
581
|
+
width?: number | string;
|
|
582
|
+
height?: number | string;
|
|
583
|
+
};
|
|
584
|
+
showRelatedOnPause?: {
|
|
585
|
+
state?: boolean;
|
|
586
|
+
onMobile?: boolean;
|
|
587
|
+
from?: number;
|
|
588
|
+
};
|
|
589
|
+
float?: {
|
|
590
|
+
state: boolean;
|
|
591
|
+
onMobile: boolean;
|
|
592
|
+
position: string;
|
|
593
|
+
dismissible: boolean;
|
|
594
|
+
requiresInteraction: boolean;
|
|
595
|
+
toVideoThreshold: number;
|
|
596
|
+
toFloatThreshold: number;
|
|
597
|
+
style: {
|
|
598
|
+
width: number;
|
|
599
|
+
border: string;
|
|
600
|
+
};
|
|
601
|
+
};
|
|
602
|
+
controls?: {
|
|
603
|
+
theaterButton?: boolean;
|
|
604
|
+
settingsButton?: boolean;
|
|
605
|
+
chromecastButton?: boolean;
|
|
606
|
+
nextButton?: boolean;
|
|
607
|
+
fullscreenButton?: boolean;
|
|
608
|
+
airplayButton?: boolean;
|
|
609
|
+
bigPlayButton?: boolean;
|
|
610
|
+
autopausePlayButton?: boolean;
|
|
611
|
+
pictureInPictureButton?: boolean;
|
|
612
|
+
relatedButton?: boolean;
|
|
613
|
+
volumeButton?: boolean;
|
|
614
|
+
shareButton?: boolean;
|
|
615
|
+
subtitlesButton?: boolean;
|
|
616
|
+
showCaptions?: boolean;
|
|
617
|
+
};
|
|
618
|
+
logo?: {
|
|
619
|
+
state?: boolean;
|
|
620
|
+
file?: string;
|
|
621
|
+
position?: string;
|
|
622
|
+
defaultOpacity?: number;
|
|
623
|
+
inactiveOpacity?: number;
|
|
624
|
+
onClickURL?: string;
|
|
625
|
+
};
|
|
626
|
+
skin?: {
|
|
627
|
+
controlBar?: {
|
|
628
|
+
background?: string;
|
|
629
|
+
spread?: "solid" | "gradient";
|
|
630
|
+
gradientMidPoint?: number;
|
|
631
|
+
text?: string;
|
|
632
|
+
icons?: {
|
|
633
|
+
default?: string;
|
|
634
|
+
hover?: string;
|
|
635
|
+
};
|
|
636
|
+
timeslider?: {
|
|
637
|
+
progress?: string;
|
|
638
|
+
rail?: string;
|
|
639
|
+
buffer?: string;
|
|
640
|
+
dragger?: string;
|
|
641
|
+
};
|
|
642
|
+
timesliderOnAd?: {
|
|
643
|
+
progress?: string;
|
|
644
|
+
rail?: string;
|
|
645
|
+
buffer?: string;
|
|
646
|
+
dragger?: string;
|
|
647
|
+
};
|
|
648
|
+
volume?: {
|
|
649
|
+
dragger?: string;
|
|
650
|
+
progress?: string;
|
|
651
|
+
rail?: string;
|
|
652
|
+
notifier?: string;
|
|
653
|
+
};
|
|
654
|
+
};
|
|
655
|
+
menus?: {
|
|
656
|
+
background?: {
|
|
657
|
+
default?: string;
|
|
658
|
+
hover?: string;
|
|
659
|
+
};
|
|
660
|
+
links?: {
|
|
661
|
+
default?: string;
|
|
662
|
+
hover?: string;
|
|
663
|
+
};
|
|
664
|
+
autoplay?: {
|
|
665
|
+
autoplayOn?: string;
|
|
666
|
+
autoplayOff?: string;
|
|
667
|
+
};
|
|
668
|
+
};
|
|
669
|
+
nextVideo?: {
|
|
670
|
+
background?: string;
|
|
671
|
+
text?: string;
|
|
672
|
+
timeslider?: {
|
|
673
|
+
rail?: string;
|
|
674
|
+
progress?: string;
|
|
675
|
+
};
|
|
676
|
+
icons?: {
|
|
677
|
+
play?: {
|
|
678
|
+
default?: string;
|
|
679
|
+
hover?: string;
|
|
680
|
+
};
|
|
681
|
+
close?: string;
|
|
682
|
+
};
|
|
683
|
+
};
|
|
684
|
+
playlist?: {
|
|
685
|
+
background?: string;
|
|
686
|
+
text?: string;
|
|
687
|
+
icons?: {
|
|
688
|
+
arrows?: {
|
|
689
|
+
active?: string;
|
|
690
|
+
inactive?: string;
|
|
691
|
+
};
|
|
692
|
+
close?: string;
|
|
693
|
+
};
|
|
694
|
+
card?: {
|
|
695
|
+
background?: string;
|
|
696
|
+
title?: string;
|
|
697
|
+
duration?: {
|
|
698
|
+
text?: string;
|
|
699
|
+
background?: string;
|
|
700
|
+
};
|
|
701
|
+
icons?: {
|
|
702
|
+
play?: {
|
|
703
|
+
default?: string;
|
|
704
|
+
hover?: string;
|
|
705
|
+
};
|
|
706
|
+
};
|
|
707
|
+
};
|
|
708
|
+
};
|
|
709
|
+
};
|
|
710
|
+
lang?: {
|
|
711
|
+
locale?: string;
|
|
712
|
+
controls?: {
|
|
713
|
+
play?: string;
|
|
714
|
+
pause?: string;
|
|
715
|
+
next?: string;
|
|
716
|
+
replay?: string;
|
|
717
|
+
volume?: string;
|
|
718
|
+
mute?: string;
|
|
719
|
+
unmute?: string;
|
|
720
|
+
settings?: string;
|
|
721
|
+
theater?: string;
|
|
722
|
+
fullscreen?: string;
|
|
723
|
+
chromecast?: string;
|
|
724
|
+
airplay?: string;
|
|
725
|
+
pictureInPicture?: string;
|
|
726
|
+
related?: string;
|
|
727
|
+
skipIntro?: string;
|
|
728
|
+
skipAd?: string;
|
|
729
|
+
playlistTitle?: string;
|
|
730
|
+
upNext?: string;
|
|
731
|
+
live?: string;
|
|
732
|
+
continueAfterPause?: string;
|
|
733
|
+
};
|
|
734
|
+
settings?: {
|
|
735
|
+
quality?: string;
|
|
736
|
+
subtitles?: string;
|
|
737
|
+
autoplay?: string;
|
|
738
|
+
playbackRate?: string;
|
|
739
|
+
auto?: string;
|
|
740
|
+
off?: string;
|
|
741
|
+
normal?: string;
|
|
742
|
+
share?: string;
|
|
743
|
+
};
|
|
744
|
+
ads?: {
|
|
745
|
+
ad?: string;
|
|
746
|
+
skip?: string;
|
|
747
|
+
skipIn?: string;
|
|
748
|
+
visit?: string;
|
|
749
|
+
info?: string;
|
|
750
|
+
simultaneousAds?: string;
|
|
751
|
+
adAnnouncement?: string;
|
|
752
|
+
};
|
|
753
|
+
messages?: {
|
|
754
|
+
playbackErrorTitle?: string;
|
|
755
|
+
playbackErrorDescription?: string;
|
|
756
|
+
geoBlockedTitle?: string;
|
|
757
|
+
geoBlockedDescription?: string;
|
|
758
|
+
streamInterruptedTitle?: string;
|
|
759
|
+
streamInterruptedDescription?: string;
|
|
760
|
+
};
|
|
761
|
+
};
|
|
762
|
+
ads?: VPPlayerAdsConfig;
|
|
763
|
+
};
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
/**
|
|
767
|
+
* Interface for the VP Player context, providing methods and state for controlling the player.
|
|
768
|
+
*
|
|
769
|
+
* @interface
|
|
770
|
+
*/
|
|
771
|
+
export declare interface VPPlayerContextType {
|
|
772
|
+
showPlayer: (params: PlayerParams) => void;
|
|
773
|
+
hidePlayer: () => void;
|
|
774
|
+
isPlayerVisible: boolean;
|
|
775
|
+
playerParams: PlayerParams | null;
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
/**
|
|
779
|
+
* Interface defining the context for VPPlayer.
|
|
780
|
+
*
|
|
781
|
+
* @interface VPPlayerContextType
|
|
782
|
+
*/
|
|
783
|
+
declare interface VPPlayerContextType_2 {
|
|
784
|
+
showPlayer: (params: PlayerParams_2) => void;
|
|
785
|
+
hidePlayer: () => void;
|
|
786
|
+
isPlayerVisible: boolean;
|
|
787
|
+
playerParams: PlayerParams_2 | null;
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
/**
|
|
791
|
+
* Interface representing an instance of the VP Player.
|
|
792
|
+
* Based on VP Player API Reference: https://vp.gjirafa.tech/documentation/docs/web-player/api-reference
|
|
793
|
+
* And VP Vertical Player API Reference: https://vp.gjirafa.tech/documentation/docs/vertical-player/api-reference
|
|
794
|
+
*
|
|
795
|
+
* @interface
|
|
796
|
+
*/
|
|
797
|
+
export declare interface VPPlayerInstance {
|
|
798
|
+
setup: (config: VPPlayerConfig) => void;
|
|
799
|
+
destroy?: () => void;
|
|
800
|
+
play?: () => void;
|
|
801
|
+
pause?: () => void;
|
|
802
|
+
forward?: () => void;
|
|
803
|
+
rewind?: () => void;
|
|
804
|
+
replay?: () => void;
|
|
805
|
+
seek?: (position: number) => void;
|
|
806
|
+
mute?: () => void;
|
|
807
|
+
unmute?: () => void;
|
|
808
|
+
enterFullScreen?: () => void;
|
|
809
|
+
exitFullScreen?: () => void;
|
|
810
|
+
enterFullscreen?: () => void;
|
|
811
|
+
exitFullscreen?: () => void;
|
|
812
|
+
enterPictureInPicture?: () => void;
|
|
813
|
+
exitPictureInPicture?: () => void;
|
|
814
|
+
togglePlay?: () => void;
|
|
815
|
+
toggleMute?: () => void;
|
|
816
|
+
isMuted?: () => boolean;
|
|
817
|
+
isPlaying?: () => boolean;
|
|
818
|
+
isPaused?: () => boolean;
|
|
819
|
+
isFullscreen?: () => boolean;
|
|
820
|
+
isEnded?: () => boolean;
|
|
821
|
+
isFocused?: () => boolean;
|
|
822
|
+
getPosition?: () => number;
|
|
823
|
+
getBuffered?: () => number;
|
|
824
|
+
getVolume?: () => number;
|
|
825
|
+
getContainer?: () => HTMLElement;
|
|
826
|
+
getDuration?: () => number;
|
|
827
|
+
getConfig?: () => VPPlayerConfig;
|
|
828
|
+
getQualityLevels?: () => unknown[];
|
|
829
|
+
getCurrentQuality?: () => number;
|
|
830
|
+
checkViewability?: () => boolean;
|
|
831
|
+
setConfig?: (config: unknown) => void;
|
|
832
|
+
setVideo?: (video: unknown) => void;
|
|
833
|
+
setPlaylist?: (playlist: unknown) => void;
|
|
834
|
+
setVolume?: (volume: number) => void;
|
|
835
|
+
setCurrentQuality?: (index: number) => void;
|
|
836
|
+
setLevelToAuto?: () => void;
|
|
837
|
+
setCuePoint?: (cue: number, callback: () => void) => void;
|
|
838
|
+
on?: (event: string, callback: (data?: unknown) => void) => void;
|
|
839
|
+
off?: (event: string, callback?: (data?: unknown) => void) => void;
|
|
840
|
+
videoIndex?: number;
|
|
841
|
+
playlist?: {
|
|
842
|
+
state: boolean;
|
|
843
|
+
playlistId: string;
|
|
844
|
+
playlistVideoIndex: number;
|
|
845
|
+
videos: unknown[];
|
|
846
|
+
};
|
|
847
|
+
multipleVideos?: Map<number, unknown>;
|
|
848
|
+
firstInList?: boolean;
|
|
849
|
+
lastInList?: boolean;
|
|
850
|
+
setupComplete?: boolean;
|
|
851
|
+
initialized?: boolean;
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
/**
|
|
855
|
+
* Interface defining the properties for the VP Player component.
|
|
856
|
+
*
|
|
857
|
+
* @interface
|
|
858
|
+
*/
|
|
859
|
+
export declare interface VPPlayerProps {
|
|
860
|
+
playerId: string;
|
|
861
|
+
config?: Partial<VPPlayerConfig>;
|
|
862
|
+
videoId?: string;
|
|
863
|
+
projectId?: string;
|
|
864
|
+
videoUrl?: string;
|
|
865
|
+
playlistId?: string;
|
|
866
|
+
scriptUrl?: string;
|
|
867
|
+
version?: string | null;
|
|
868
|
+
isReels?: boolean;
|
|
869
|
+
thumbnailUrl?: string;
|
|
870
|
+
onClose?: () => void;
|
|
871
|
+
hiddenClasses?: string[];
|
|
872
|
+
isPlayerVisible?: boolean;
|
|
873
|
+
className?: string;
|
|
874
|
+
/**
|
|
875
|
+
* When true (default), skips all wrapper defaults and passes only minimal config to the SDK.
|
|
876
|
+
* This lets the GTech admin panel settings be the source of truth for
|
|
877
|
+
* controls, autoplay, muted, size, and other configuration.
|
|
878
|
+
* Set to false to use legacy behavior with wrapper defaults.
|
|
879
|
+
* @default true
|
|
880
|
+
*/
|
|
881
|
+
pureMode?: boolean;
|
|
882
|
+
onPlaylistData?: (videos: PlaylistItem_2[]) => void;
|
|
883
|
+
onVideoStarted?: (videoData: CurrentVideoData_2) => void;
|
|
884
|
+
/**
|
|
885
|
+
* Video metadata for tracking/analytics callbacks
|
|
886
|
+
*/
|
|
887
|
+
trackingMetadata?: PlayerTrackingMetadata_2;
|
|
888
|
+
onPlayerStart?: PlayerEventCallbacks_2["onPlayerStart"];
|
|
889
|
+
onPlayerPlay?: PlayerEventCallbacks_2["onPlayerPlay"];
|
|
890
|
+
onPlayerPause?: PlayerEventCallbacks_2["onPlayerPause"];
|
|
891
|
+
onPlayerResume?: PlayerEventCallbacks_2["onPlayerResume"];
|
|
892
|
+
onPlayerEnd?: PlayerEventCallbacks_2["onPlayerEnd"];
|
|
893
|
+
onPlayerProgressEvery10Seconds?: PlayerEventCallbacks_2["onPlayerProgressEvery10Seconds"];
|
|
894
|
+
onPlayerProgressAt20Seconds?: PlayerEventCallbacks_2["onPlayerProgressAt20Seconds"];
|
|
895
|
+
onPlayerQuartile25?: PlayerEventCallbacks_2["onPlayerQuartile25"];
|
|
896
|
+
onPlayerQuartile50?: PlayerEventCallbacks_2["onPlayerQuartile50"];
|
|
897
|
+
onPlayerQuartile75?: PlayerEventCallbacks_2["onPlayerQuartile75"];
|
|
898
|
+
onPlayerNext?: PlayerEventCallbacks_2["onPlayerNext"];
|
|
899
|
+
onPlayerPrevious?: PlayerEventCallbacks_2["onPlayerPrevious"];
|
|
900
|
+
/**
|
|
901
|
+
* Universal callback for all events - called in addition to specific callbacks
|
|
902
|
+
* this gives us all event in one callback
|
|
903
|
+
*/
|
|
904
|
+
onPlayerEvent?: PlayerEventCallbacks_2["onPlayerEvent"];
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
/**
|
|
908
|
+
* VPPlayerProvider component provides context for managing the VPPlayer state.
|
|
909
|
+
*
|
|
910
|
+
* @function
|
|
911
|
+
* @param {Object} props - The component props.
|
|
912
|
+
* @param {React.ReactNode} props.children - The child components.
|
|
913
|
+
* @returns {JSX.Element} The provider component for VPPlayer.
|
|
914
|
+
*/
|
|
915
|
+
export declare const VPPlayerProvider: default_2.FC<{
|
|
916
|
+
children: default_2.ReactNode;
|
|
917
|
+
}>;
|
|
918
|
+
|
|
919
|
+
export { }
|