@devix-technologies/react-gjirafa-vp-player 1.0.31-beta.1 → 1.0.31-beta.11

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/index.d.ts CHANGED
@@ -1,71 +1,210 @@
1
1
  import { CurrentVideoData as CurrentVideoData_2 } from '../../../../../../../src/types';
2
- import { default as default_2 } from 'react';
3
2
  import { DetailedHTMLProps } from 'react';
3
+ import { ForwardRefExoticComponent } from 'react';
4
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';
5
+ import { RefAttributes } from 'react';
9
6
  import { RefObject } from 'react';
10
7
  import { StyledComponent } from '@emotion/styled';
11
8
  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
9
  import { VPPlayerInstance as VPPlayerInstance_2 } from '../../../../../../../src/interfaces';
15
10
  import { VPPlayerProps as VPPlayerProps_2 } from '../../../../../../../src/interfaces';
11
+ import { VPPlayerRef as VPPlayerRef_2 } from '../../../../../../../src/interfaces';
16
12
 
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=";
13
+ /**
14
+ * Ad announcement configuration
15
+ */
16
+ export declare interface AdAnnouncementConfig {
17
+ state: boolean;
18
+ timeBeforeAd: number;
19
+ }
19
20
 
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=";
21
+ /**
22
+ * Ad break configuration
23
+ */
24
+ export declare interface AdBreak {
25
+ adTagUrl: string[];
26
+ breakType: "preroll" | "midroll" | "postroll";
27
+ breakTimingType: "time" | "percentage" | "playlist";
28
+ breakTimingValue: number;
29
+ }
22
30
 
23
31
  /**
24
- * Base configuration for VP Player with common settings.
32
+ * Ad function configuration
25
33
  */
26
- export declare const baseConfig: Partial<VPPlayerConfig_3>;
34
+ export declare interface AdFunction {
35
+ isDynamicKey: boolean;
36
+ isDynamicValue: boolean;
37
+ key: string;
38
+ order: number;
39
+ value: string;
40
+ }
27
41
 
28
42
  /**
29
- * Base configuration for ads with common ad settings.
43
+ * Advertising configuration
30
44
  */
31
- export declare const baseConfigWithAds: Partial<VPPlayerConfig_3>;
45
+ export declare interface AdsConfig {
46
+ skipAd?: AdSkipConfig;
47
+ vmap?: string;
48
+ VPAIDmode?: string;
49
+ enableProgrammability?: boolean;
50
+ functions?: AdFunction[];
51
+ bidding?: boolean;
52
+ afterMidrollBacktrack?: AfterMidrollBacktrack;
53
+ adBreaks?: AdBreak[];
54
+ bidders?: BidderConfig[];
55
+ }
32
56
 
33
57
  /**
34
- * Base configuration with autoplay enabled.
58
+ * Ad skip configuration
35
59
  */
36
- export declare const baseConfigWithAutoplay: Partial<VPPlayerConfig_3>;
60
+ export declare interface AdSkipConfig {
61
+ state: boolean;
62
+ skipFrom: number;
63
+ }
37
64
 
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";
65
+ /**
66
+ * Ads localization
67
+ */
68
+ export declare interface AdsLang {
69
+ ad?: string;
70
+ skip?: string;
71
+ skipIn?: string;
72
+ visit?: string;
73
+ info?: string;
74
+ simultaneousAds?: string;
75
+ }
40
76
 
41
77
  /**
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
78
+ * After midroll backtrack configuration
51
79
  */
52
- export declare const buildVPPlayerConfig: ({ videoUrl, projectId, config, isVerticalPlayer, pureMode, }: ConfigBuilderOptions) => VPPlayerConfig_2;
80
+ export declare interface AfterMidrollBacktrack {
81
+ state: boolean;
82
+ seconds: number;
83
+ }
53
84
 
54
85
  /**
55
- * Interface for options used in building the VP Player configuration.
86
+ * Appends the divId query parameter to a script URL.
87
+ * This tells the managed script which DOM element to use as the player container.
56
88
  *
57
- * @interface ConfigBuilderOptions
89
+ * @param url - The base script URL
90
+ * @param divId - The DOM element ID for the player container
91
+ * @returns The URL with ?divId= parameter appended
92
+ * @example
93
+ * appendDivIdToUrl('https://host.vpplayer.tech/player/ptkzurnx/vjsobqhe.js', 'my-player')
94
+ * // Returns: 'https://host.vpplayer.tech/player/ptkzurnx/vjsobqhe.js?divId=my-player'
58
95
  */
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;
96
+ export declare const appendDivIdToUrl: (url: string, divId: string) => string;
97
+
98
+ /**
99
+ * Autopause on viewable configuration
100
+ */
101
+ export declare interface AutopauseOnViewableConfig {
102
+ state: boolean;
103
+ percentageViewable?: number;
104
+ }
105
+
106
+ /**
107
+ * Autoplay toggle skin
108
+ */
109
+ export declare interface AutoplaySkin {
110
+ autoplayOn?: string;
111
+ autoplayOff?: string;
112
+ }
113
+
114
+ /**
115
+ * Autostart on load configuration
116
+ */
117
+ export declare interface AutostartOnLoadConfig {
118
+ state: boolean;
119
+ onMobile?: boolean;
120
+ onData?: boolean;
121
+ }
122
+
123
+ /**
124
+ * Autostart on viewable configuration
125
+ */
126
+ export declare interface AutostartOnViewableConfig {
127
+ state: boolean;
128
+ onMobile?: boolean;
129
+ onData?: boolean;
130
+ percentageViewable?: number;
131
+ }
132
+
133
+ /**
134
+ * Bidder configuration
135
+ */
136
+ export declare interface BidderConfig {
137
+ name: string;
138
+ params: Record<string, string>;
139
+ }
140
+
141
+ /**
142
+ * Control bar skin configuration
143
+ */
144
+ export declare interface ControlBarSkin {
145
+ background?: string;
146
+ text?: string;
147
+ icons?: IconsSkin;
148
+ timeslider?: TimesliderSkin;
149
+ volume?: VolumeSkin;
150
+ timesliderOnAd?: TimesliderSkin;
151
+ }
152
+
153
+ /**
154
+ * Controls visibility configuration
155
+ */
156
+ export declare interface ControlsConfig {
157
+ theaterButton?: boolean;
158
+ settingsButton?: boolean;
159
+ chromecastButton?: boolean;
160
+ nextButton?: boolean;
161
+ fullscreenButton?: boolean;
162
+ airplayButton?: boolean;
163
+ bigPlayButton?: boolean;
164
+ pictureInPictureButton?: boolean;
165
+ relatedButton?: boolean;
166
+ volumeButton?: boolean;
167
+ shareButton?: boolean;
168
+ subtitlesButton?: boolean;
169
+ showCaptions?: boolean;
170
+ audioOnlyButton?: boolean;
171
+ rewindButton?: boolean;
172
+ forwardButton?: boolean;
173
+ chaptersButton?: boolean;
174
+ showHelperButton?: boolean | null;
175
+ helperButtonImage?: string;
176
+ showLiveIcon?: boolean | null;
177
+ delayLiveVideosTime?: number;
178
+ delayLiveVideos?: boolean | null;
179
+ showAutoPlay?: boolean | null;
180
+ showQualities?: boolean | null;
181
+ }
182
+
183
+ /**
184
+ * Controls localization
185
+ */
186
+ export declare interface ControlsLang {
187
+ play?: string;
188
+ pause?: string;
189
+ next?: string;
190
+ replay?: string;
191
+ volume?: string;
192
+ mute?: string;
193
+ unmute?: string;
194
+ settings?: string;
195
+ theater?: string;
196
+ fullscreen?: string;
197
+ chromecast?: string;
198
+ airplay?: string;
199
+ pictureInPicture?: string;
200
+ related?: string;
201
+ skipIntro?: string;
202
+ skipAd?: string;
203
+ adAnnouncement?: string;
204
+ playlistTitle?: string;
205
+ upNext?: string;
206
+ live?: string;
207
+ continueAfterPause?: string;
69
208
  }
70
209
 
71
210
  /**
@@ -94,44 +233,179 @@ export declare interface CurrentVideoData {
94
233
  }
95
234
 
96
235
  /**
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.
236
+ * VP Player Configuration Types
102
237
  *
103
- * @constant
104
- * @type {VPPlayerConfig}
105
- * @see {@link https://vp.gjirafa.tech/documentation/docs/web-player/setup-the-player/configuration}
238
+ * Fully typed configuration based on VP Player documentation.
239
+ * @see {@link https://vp.gjirafa.tech/documentation/docs/web-player/setup-the-player/full-configuration}
240
+ * @see {@link https://vp.gjirafa.tech/documentation/docs/vertical-player/setup-the-player/configration}
241
+ */
242
+ /**
243
+ * Deep partial utility type - makes all nested properties optional
106
244
  */
107
- export declare const defaultVPPlayerConfig: VPPlayerConfig;
245
+ export declare type DeepPartial<T> = T extends object ? {
246
+ [P in keyof T]?: DeepPartial<T[P]>;
247
+ } : T;
108
248
 
109
- /** URL for the Elephants Dream video */
110
- export declare const ELEPHANTS_DREAM_URL = "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4";
249
+ /**
250
+ * Event callback refs interface for internal use
251
+ * Prevents stale closures in event handlers
252
+ */
253
+ export declare interface EventCallbackRefs {
254
+ onReady?: (data?: CurrentVideoData_2) => void;
255
+ onPlay?: (data?: CurrentVideoData_2) => void;
256
+ onPause?: () => void;
257
+ onResume?: () => void;
258
+ onComplete?: () => void;
259
+ onError?: (error: string) => void;
260
+ onVideoStarted?: (data: CurrentVideoData_2) => void;
261
+ onTimeUpdate?: (seconds: number) => void;
262
+ onQuartile25?: () => void;
263
+ onQuartile50?: () => void;
264
+ onQuartile75?: () => void;
265
+ onNext?: () => void;
266
+ onPrevious?: () => void;
267
+ onProgress10s?: (seconds: number) => void;
268
+ onProgress20s?: (seconds: number) => void;
269
+ }
270
+
271
+ /**
272
+ * Float (picture-in-picture) configuration
273
+ */
274
+ export declare interface FloatConfig {
275
+ state: boolean;
276
+ onMobile?: boolean;
277
+ position?: "TOP_LEFT" | "TOP_RIGHT" | "BOTTOM_LEFT" | "BOTTOM_RIGHT";
278
+ dismissible?: boolean;
279
+ requiresInteraction?: boolean;
280
+ toVideoThreshold?: number;
281
+ toFloatThreshold?: number;
282
+ style?: FloatStyleConfig;
283
+ }
111
284
 
112
285
  /**
113
- * Extracts the video ID from a given VP Player script URL.
286
+ * Float style configuration
287
+ */
288
+ export declare interface FloatStyleConfig {
289
+ width: number;
290
+ border?: string;
291
+ }
292
+
293
+ /**
294
+ * Generates a full player DOM element ID based on provided playerId and videoId.
295
+ * Falls back to "default" if playerId is not provided.
114
296
  *
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
297
+ * @param playerId - Base identifier for the player.
298
+ * @param videoId - Optional video identifier.
299
+ * @returns Full DOM element ID string.
300
+ */
301
+ export declare const generatePlayerId: (playerId?: string, videoId?: string) => string;
302
+
303
+ /**
304
+ * Generates the URL for a FULLY managed video-specific player script.
305
+ * This script auto-initializes with all config from GTech admin panel -
306
+ * NO .setup() call needed! Chapters, ads, controls, etc. are all pre-configured.
119
307
  *
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.
308
+ * @param {string} scriptId - The player script ID (e.g., 'ptkzurnx').
309
+ * @param {string} videoId - The video ID (e.g., 'vjsobqhe').
310
+ * @returns {string} - The complete URL for the fully managed player script.
311
+ * @example
312
+ * // Returns: https://host.vpplayer.tech/player/ptkzurnx/vjsobqhe.js
313
+ * getFullyManagedPlayerScriptUrl('ptkzurnx', 'vjsobqhe')
314
+ */
315
+ export declare const getFullyManagedPlayerScriptUrl: (scriptId: string, videoId: string) => string;
316
+
317
+ /**
318
+ * Generates the URL for loading a managed VP Player script (Web Player).
319
+ * This script requires calling .setup() with your config.
320
+ * @param {string} scriptId - The unique script ID (e.g., 'ptkzurly').
321
+ * @returns {string} - The complete URL for the managed player script.
322
+ */
323
+ export declare const getManagedPlayerScriptUrl: (scriptId: string) => string;
324
+
325
+ /**
326
+ * Generates the URL for loading the standard VP Player script by version.
327
+ * @param {string} playerVersion - The version of the VP Player script (e.g., 'latest', 'v2.1.1').
328
+ * @returns {string} - The complete URL for the player script.
123
329
  */
124
- export declare const extractVideoId: (scriptUrl?: string) => string | undefined;
330
+ export declare const getPlayerScriptUrl: (playerVersion: string) => string;
125
331
 
126
332
  /**
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.
333
+ * Generates the URL for loading a vertical VP Player script.
334
+ * @param {string} scriptId - The unique script ID (e.g., 'rbqcdwzlg').
335
+ * @returns {string} - The complete URL for the vertical player script.
133
336
  */
134
- export declare const getAdConfig: (breakType: "preroll" | "postroll" | "midroll", adTagUrls: string[], breakTimingType?: "time" | "percentage" | "playlist", breakTimingValue?: number) => Partial<VPPlayerConfig_3>;
337
+ export declare const getVerticalPlayerScriptUrl: (scriptId: string) => string;
338
+
339
+ /**
340
+ * Icons skin configuration
341
+ */
342
+ export declare interface IconsSkin {
343
+ default?: string;
344
+ hover?: string;
345
+ }
346
+
347
+ /**
348
+ * Full localization configuration
349
+ */
350
+ export declare interface LangConfig {
351
+ locale?: string;
352
+ controls?: ControlsLang;
353
+ settings?: SettingsLang;
354
+ ads?: AdsLang;
355
+ }
356
+
357
+ /**
358
+ * Logo configuration
359
+ */
360
+ export declare interface LogoConfig {
361
+ state: boolean;
362
+ file?: string;
363
+ position?: "TOP_LEFT" | "TOP_RIGHT" | "BOTTOM_LEFT" | "BOTTOM_RIGHT";
364
+ defaultOpacity?: number;
365
+ inactiveOpacity?: number;
366
+ onClickURL?: string;
367
+ }
368
+
369
+ /**
370
+ * Menu background skin
371
+ */
372
+ export declare interface MenuBackgroundSkin {
373
+ default?: string;
374
+ hover?: string;
375
+ }
376
+
377
+ /**
378
+ * Menu links skin
379
+ */
380
+ export declare interface MenuLinksSkin {
381
+ default?: string;
382
+ hover?: string;
383
+ }
384
+
385
+ /**
386
+ * Menus skin configuration
387
+ */
388
+ export declare interface MenusSkin {
389
+ background?: MenuBackgroundSkin;
390
+ links?: MenuLinksSkin;
391
+ autoplay?: AutoplaySkin;
392
+ }
393
+
394
+ /**
395
+ * Next video skin configuration
396
+ */
397
+ export declare interface NextVideoSkin {
398
+ background?: string;
399
+ text?: string;
400
+ timeslider?: {
401
+ rail?: string;
402
+ progress?: string;
403
+ };
404
+ icons?: {
405
+ play?: PlayIconSkin;
406
+ close?: string;
407
+ };
408
+ }
135
409
 
136
410
  /**
137
411
  * Styled component for the full-screen overlay when the player is active.
@@ -146,12 +420,6 @@ as?: React.ElementType;
146
420
  className?: string;
147
421
  }, DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
148
422
 
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
423
  /**
156
424
  * Styled component for the video player container.
157
425
  *
@@ -232,52 +500,33 @@ export declare interface PlayerObject {
232
500
  }
233
501
 
234
502
  /**
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
503
+ * Player settings configuration (the `config` object in VP Player)
267
504
  */
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;
505
+ export declare interface PlayerSettingsConfig {
506
+ configId?: string;
507
+ size?: SizeConfig;
508
+ adAnnouncement?: AdAnnouncementConfig;
509
+ autoplay?: boolean;
510
+ autostartOnLoad?: AutostartOnLoadConfig;
511
+ autostartOnViewable?: AutostartOnViewableConfig;
512
+ autopauseOnViewable?: AutopauseOnViewableConfig;
513
+ pauseOtherVideos?: boolean;
514
+ focusOnAutostart?: boolean;
515
+ showRelatedOnPause?: ShowRelatedOnPauseConfig;
516
+ playbackRates?: number[];
517
+ volume?: number;
518
+ muted?: boolean;
519
+ loop?: boolean;
520
+ casting?: boolean;
521
+ debug?: boolean;
522
+ skipAmount?: number;
523
+ adsRequireInteraction?: boolean;
524
+ float?: FloatConfig;
525
+ controls?: ControlsConfig;
526
+ logo?: LogoConfig;
527
+ socialMedia?: unknown[];
528
+ lang?: LangConfig;
529
+ skin?: SkinConfig;
281
530
  }
282
531
 
283
532
  /**
@@ -306,6 +555,14 @@ as?: React.ElementType;
306
555
  className?: string;
307
556
  }, DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
308
557
 
558
+ /**
559
+ * Play icon skin
560
+ */
561
+ export declare interface PlayIconSkin {
562
+ default?: string;
563
+ hover?: string;
564
+ }
565
+
309
566
  /**
310
567
  * API response structure for fetching playlist data.
311
568
  *
@@ -315,6 +572,47 @@ export declare interface PlaylistApiResponse {
315
572
  result: PlaylistItem[];
316
573
  }
317
574
 
575
+ /**
576
+ * Playlist arrows skin
577
+ */
578
+ export declare interface PlaylistArrowsSkin {
579
+ active?: string;
580
+ inactive?: string;
581
+ }
582
+
583
+ /**
584
+ * Playlist card duration skin
585
+ */
586
+ export declare interface PlaylistCardDurationSkin {
587
+ text?: string;
588
+ background?: string;
589
+ }
590
+
591
+ /**
592
+ * Playlist card skin
593
+ */
594
+ export declare interface PlaylistCardSkin {
595
+ background?: string;
596
+ title?: string;
597
+ duration?: PlaylistCardDurationSkin;
598
+ icons?: {
599
+ play?: PlayIconSkin;
600
+ };
601
+ }
602
+
603
+ /**
604
+ * Playlist configuration
605
+ */
606
+ export declare interface PlaylistConfig {
607
+ state: boolean;
608
+ playlistId: string;
609
+ playlistVideoIndex: number;
610
+ highlightCurrentVideo?: boolean;
611
+ algorithm?: string;
612
+ title?: string;
613
+ videos: PlaylistVideoConfig[];
614
+ }
615
+
318
616
  /**
319
617
  * Represents an item in a video playlist.
320
618
  *
@@ -335,19 +633,99 @@ export declare interface PlaylistItem {
335
633
  }
336
634
 
337
635
  /**
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.
636
+ * Playlist skin configuration
637
+ */
638
+ export declare interface PlaylistSkin {
639
+ background?: string;
640
+ text?: string;
641
+ icons?: {
642
+ arrows?: PlaylistArrowsSkin;
643
+ close?: string;
644
+ };
645
+ card?: PlaylistCardSkin;
646
+ }
647
+
648
+ /**
649
+ * Playlist video item in config
650
+ */
651
+ export declare interface PlaylistVideoConfig {
652
+ videoId: string;
653
+ title: string;
654
+ file: string;
655
+ thumbnailUrl?: string;
656
+ duration?: number;
657
+ }
658
+
659
+ /**
660
+ * Settings localization
343
661
  */
344
- export declare const useVPPlayer: () => VPPlayerContextType_2;
662
+ export declare interface SettingsLang {
663
+ quality?: string;
664
+ subtitles?: string;
665
+ autoplay?: string;
666
+ playbackRate?: string;
667
+ auto?: string;
668
+ off?: string;
669
+ normal?: string;
670
+ share?: string;
671
+ }
345
672
 
346
673
  /**
347
- * Custom hook to manage VP Player logic.
348
- * Uses native SDK events instead of manual progress tracking.
674
+ * Show related on pause configuration
675
+ */
676
+ export declare interface ShowRelatedOnPauseConfig {
677
+ state: boolean;
678
+ onMobile?: boolean;
679
+ from?: number;
680
+ }
681
+
682
+ /**
683
+ * Size configuration
684
+ */
685
+ export declare interface SizeConfig {
686
+ sizeType: "RESPONSIVE" | "FIXED";
687
+ aspectRatio?: "16:9" | "9:16" | "4:3" | "1:1";
688
+ width?: number;
689
+ height?: number;
690
+ }
691
+
692
+ /**
693
+ * Full skin configuration
694
+ */
695
+ export declare interface SkinConfig {
696
+ controlBar?: ControlBarSkin;
697
+ menus?: MenusSkin;
698
+ nextVideo?: NextVideoSkin;
699
+ playlist?: PlaylistSkin;
700
+ }
701
+
702
+ /**
703
+ * Skip intro configuration
704
+ */
705
+ export declare interface SkipIntroConfig {
706
+ state: boolean;
707
+ skipFrom: number;
708
+ skipTo: number;
709
+ }
710
+
711
+ /**
712
+ * Timeslider skin configuration
713
+ */
714
+ export declare interface TimesliderSkin {
715
+ progress?: string;
716
+ rail?: string;
717
+ buffer?: string | null;
718
+ dragger?: string;
719
+ }
720
+
721
+ /**
722
+ * VP Player logic hook
723
+ *
724
+ * Supports two modes:
725
+ * 1. **Auto-init mode** (default): Load managed script that auto-initializes with GTech admin config
726
+ * 2. **Config override mode**: Fetch config, merge user overrides, and call setup()
349
727
  */
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) => {
728
+ export declare const useVPPlayerLogic: ({ scriptId, videoId, scriptUrl, projectId, config, playerId, isVertical, isReels, onReady, onPlay, onPause, onResume, onComplete, onError, onVideoStarted, onTimeUpdate, onQuartile25, onQuartile50, onQuartile75, onNext, onPrevious, onProgress10s, onProgress20s, }: VPPlayerProps_2) => {
351
729
  playerRef: RefObject<HTMLDivElement | null>;
352
730
  playerInstanceRef: RefObject<VPPlayerInstance_2 | null>;
353
731
  isScriptLoaded: boolean;
@@ -392,6 +770,33 @@ export declare interface VideoApiResponse {
392
770
  };
393
771
  }
394
772
 
773
+ /**
774
+ * Video configuration
775
+ */
776
+ export declare interface VideoConfig {
777
+ videoId?: string;
778
+ assetId?: string;
779
+ fpsCertificateUrl?: string;
780
+ widevineLicenseUrl?: string;
781
+ related?: string;
782
+ file?: string;
783
+ title?: string;
784
+ duration?: number;
785
+ description?: string;
786
+ live?: boolean;
787
+ liveType?: string;
788
+ thumbnail?: string;
789
+ filmstrip?: string;
790
+ tracks?: unknown[];
791
+ startTime?: number;
792
+ skipIntro?: SkipIntroConfig;
793
+ flags?: VideoFlag[];
794
+ playlist?: PlaylistConfig;
795
+ advertising?: boolean;
796
+ adId?: string;
797
+ ads?: AdsConfig;
798
+ }
799
+
395
800
  /**
396
801
  * Result structure returned by the video data fetching logic.
397
802
  *
@@ -405,397 +810,132 @@ export declare interface VideoDataResult {
405
810
  }
406
811
 
407
812
  /**
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;
813
+ * Video flag/tag
814
+ */
815
+ export declare interface VideoFlag {
816
+ id: number;
817
+ name: string;
818
+ }
447
819
 
448
820
  /**
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}
821
+ * Volume skin configuration
453
822
  */
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;
823
+ export declare interface VolumeSkin {
824
+ dragger?: string;
825
+ progress?: string;
826
+ rail?: string;
827
+ notifier?: string;
503
828
  }
504
829
 
505
830
  /**
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}
831
+ * Base URL for the VP Player host.
515
832
  */
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
- }
833
+ export declare const VP_PLAYER_BASE_URL = "https://host.vpplayer.tech";
765
834
 
766
835
  /**
767
- * Interface for the VP Player context, providing methods and state for controlling the player.
836
+ * VP Player Component
837
+ *
838
+ * A thin React wrapper for the GTech VP Player.
839
+ * Configuration can be managed through the GTech admin panel or via the `config` prop.
840
+ *
841
+ * ## Basic Usage
842
+ *
843
+ * ```tsx
844
+ * // Using scriptId + videoId (recommended)
845
+ * <VPPlayer
846
+ * scriptId="ptkzurnx"
847
+ * videoId="vjsobqhe"
848
+ * onPlay={() => console.log('Playing!')}
849
+ * />
850
+ *
851
+ * // OR using full script URL
852
+ * <VPPlayer
853
+ * scriptUrl="https://host.vpplayer.tech/player/ptkzurnx/vjsobqhe.js"
854
+ * onPlay={() => console.log('Playing!')}
855
+ * />
856
+ * ```
857
+ *
858
+ * ## Using the ref for imperative control
859
+ *
860
+ * ```tsx
861
+ * const playerRef = useRef<VPPlayerRef>(null);
768
862
  *
769
- * @interface
863
+ * <VPPlayer
864
+ * ref={playerRef}
865
+ * scriptId="ptkzurnx"
866
+ * videoId="vjsobqhe"
867
+ * />
868
+ *
869
+ * // Later:
870
+ * playerRef.current?.seek(60);
871
+ * playerRef.current?.play();
872
+ * console.log(playerRef.current?.getPosition());
873
+ * ```
874
+ *
875
+ * ## Config Override Mode
876
+ *
877
+ * Override the fetched configuration with custom settings:
878
+ *
879
+ * ```tsx
880
+ * <VPPlayer
881
+ * scriptId="ptkzurnx"
882
+ * videoId="vjsobqhe"
883
+ * config={{
884
+ * config: {
885
+ * muted: true,
886
+ * autoplay: true,
887
+ * skin: {
888
+ * controlBar: {
889
+ * background: 'rgba(0,0,0,0.8)'
890
+ * }
891
+ * }
892
+ * }
893
+ * }}
894
+ * />
895
+ * ```
896
+ *
897
+ * ## Reels Mode
898
+ *
899
+ * For TikTok-style vertical videos with overlay:
900
+ *
901
+ * ```tsx
902
+ * <VPPlayer
903
+ * scriptId="rbqcdwzlg"
904
+ * videoId="vjsobqhe"
905
+ * isReels={true}
906
+ * thumbnailUrl="https://example.com/thumb.jpg"
907
+ * onClose={() => console.log('Closed')}
908
+ * />
909
+ * ```
910
+ *
911
+ * @param props - VPPlayer configuration props
770
912
  */
771
- export declare interface VPPlayerContextType {
772
- showPlayer: (params: PlayerParams) => void;
773
- hidePlayer: () => void;
774
- isPlayerVisible: boolean;
775
- playerParams: PlayerParams | null;
776
- }
913
+ export declare const VPPlayer: ForwardRefExoticComponent<VPPlayerProps_2 & RefAttributes<VPPlayerRef_2>>;
777
914
 
778
915
  /**
779
- * Interface defining the context for VPPlayer.
780
- *
781
- * @interface VPPlayerContextType
916
+ * Full VP Player configuration
917
+ * This is the root configuration object passed to vpPlayer().setup()
782
918
  */
783
- declare interface VPPlayerContextType_2 {
784
- showPlayer: (params: PlayerParams_2) => void;
785
- hidePlayer: () => void;
786
- isPlayerVisible: boolean;
787
- playerParams: PlayerParams_2 | null;
919
+ export declare interface VPPlayerConfig {
920
+ projectId?: string;
921
+ biskoId?: string;
922
+ video?: VideoConfig;
923
+ config?: PlayerSettingsConfig;
788
924
  }
789
925
 
790
926
  /**
791
927
  * 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
928
  *
795
- * @interface
929
+ * NOTE: The VP Player SDK does not ship with TypeScript types.
930
+ * This is our own type definition based on the official API documentation.
931
+ *
932
+ * @see https://vp.gjirafa.tech/documentation/docs/web-player/api-reference
933
+ * @see https://vp.gjirafa.tech/documentation/docs/vertical-player/api-reference
934
+ *
935
+ * @interface VPPlayerInstance
796
936
  */
797
937
  export declare interface VPPlayerInstance {
798
- setup: (config: VPPlayerConfig) => void;
938
+ setup: (config: unknown) => void;
799
939
  destroy?: () => void;
800
940
  play?: () => void;
801
941
  pause?: () => void;
@@ -809,8 +949,6 @@ export declare interface VPPlayerInstance {
809
949
  exitFullScreen?: () => void;
810
950
  enterFullscreen?: () => void;
811
951
  exitFullscreen?: () => void;
812
- enterPictureInPicture?: () => void;
813
- exitPictureInPicture?: () => void;
814
952
  togglePlay?: () => void;
815
953
  toggleMute?: () => void;
816
954
  isMuted?: () => boolean;
@@ -824,7 +962,7 @@ export declare interface VPPlayerInstance {
824
962
  getVolume?: () => number;
825
963
  getContainer?: () => HTMLElement;
826
964
  getDuration?: () => number;
827
- getConfig?: () => VPPlayerConfig;
965
+ getConfig?: () => unknown;
828
966
  getQualityLevels?: () => unknown[];
829
967
  getCurrentQuality?: () => number;
830
968
  checkViewability?: () => boolean;
@@ -852,68 +990,212 @@ export declare interface VPPlayerInstance {
852
990
  }
853
991
 
854
992
  /**
855
- * Interface defining the properties for the VP Player component.
993
+ * Simplified props interface for VPPlayer
994
+ *
995
+ * The wrapper is a thin bridge to the GTech JS player.
996
+ * Configuration can be managed through the GTech admin panel or via the `config` prop.
856
997
  *
857
- * @interface
998
+ * @interface VPPlayerProps
858
999
  */
859
1000
  export declare interface VPPlayerProps {
860
- playerId: string;
861
- config?: Partial<VPPlayerConfig>;
1001
+ /**
1002
+ * GTech script ID (e.g., 'ptkzurnx')
1003
+ * Used with videoId to build the fully managed script URL
1004
+ */
1005
+ scriptId?: string;
1006
+ /**
1007
+ * GTech video ID (e.g., 'vjsobqhe')
1008
+ * Used with scriptId to build the fully managed script URL
1009
+ */
862
1010
  videoId?: string;
863
- projectId?: string;
864
- videoUrl?: string;
865
- playlistId?: string;
1011
+ /**
1012
+ * Full managed script URL (alternative to scriptId + videoId)
1013
+ * @example "https://host.vpplayer.tech/player/ptkzurnx/vjsobqhe.js"
1014
+ */
866
1015
  scriptUrl?: string;
867
- version?: string | null;
1016
+ /**
1017
+ * GTech project ID
1018
+ * Convenience prop that gets merged into config.projectId
1019
+ * Can also be set directly in the config prop
1020
+ */
1021
+ projectId?: string;
1022
+ /**
1023
+ * Player configuration overrides.
1024
+ * When provided, the wrapper will:
1025
+ * 1. Try to fetch the JSON config from VP Player API
1026
+ * 2. Deep merge your overrides into the fetched config
1027
+ * 3. Call setup() with the merged configuration
1028
+ *
1029
+ * If fetch fails, your config will be used directly.
1030
+ *
1031
+ * @example
1032
+ * ```tsx
1033
+ * <VPPlayer
1034
+ * scriptId="ptkzurnx"
1035
+ * videoId="vjsobqhe"
1036
+ * config={{
1037
+ * config: {
1038
+ * muted: true,
1039
+ * autoplay: true,
1040
+ * skin: {
1041
+ * controlBar: {
1042
+ * background: 'rgba(0,0,0,0.8)'
1043
+ * }
1044
+ * }
1045
+ * }
1046
+ * }}
1047
+ * />
1048
+ * ```
1049
+ *
1050
+ * @see {@link https://vp.gjirafa.tech/documentation/docs/web-player/setup-the-player/full-configuration}
1051
+ */
1052
+ config?: DeepPartial<VPPlayerConfig>;
1053
+ /**
1054
+ * Custom container ID for the player div
1055
+ * Auto-generated if not provided
1056
+ */
1057
+ playerId?: string;
1058
+ /**
1059
+ * Use vertical player script URL builder
1060
+ * When true, uses /vertical-player/{scriptId}.js pattern
1061
+ */
1062
+ isVertical?: boolean;
1063
+ /**
1064
+ * Enable Reels/TikTok-style overlay mode
1065
+ * Shows thumbnail first, then fullscreen overlay when clicked
1066
+ */
868
1067
  isReels?: boolean;
1068
+ /**
1069
+ * Thumbnail URL for Reels mode
1070
+ */
869
1071
  thumbnailUrl?: string;
1072
+ /**
1073
+ * Callback when Reels overlay is closed
1074
+ */
870
1075
  onClose?: () => void;
871
- hiddenClasses?: string[];
872
- isPlayerVisible?: boolean;
1076
+ /**
1077
+ * Additional CSS class name for the player container
1078
+ */
873
1079
  className?: string;
874
1080
  /**
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
1081
+ * CSS classes to hide specific SDK elements
1082
+ * @example ['vp-share-button', 'vp-logo']
880
1083
  */
881
- pureMode?: boolean;
882
- onPlaylistData?: (videos: PlaylistItem_2[]) => void;
883
- onVideoStarted?: (videoData: CurrentVideoData_2) => void;
1084
+ hiddenClasses?: string[];
884
1085
  /**
885
- * Video metadata for tracking/analytics callbacks
1086
+ * Called when the player is ready/initialized
1087
+ * @param data - Optional video metadata (available in vertical player)
886
1088
  */
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"];
1089
+ onReady?: (data?: CurrentVideoData_2) => void;
900
1090
  /**
901
- * Universal callback for all events - called in addition to specific callbacks
902
- * this gives us all event in one callback
1091
+ * Called when playback starts
1092
+ * @param data - Optional video metadata (available in vertical player)
1093
+ */
1094
+ onPlay?: (data?: CurrentVideoData_2) => void;
1095
+ /**
1096
+ * Called when playback is paused
1097
+ */
1098
+ onPause?: () => void;
1099
+ /**
1100
+ * Called when playback resumes after being paused
1101
+ */
1102
+ onResume?: () => void;
1103
+ /**
1104
+ * Called when video playback completes
1105
+ */
1106
+ onComplete?: () => void;
1107
+ /**
1108
+ * Called when an error occurs
1109
+ */
1110
+ onError?: (error: string) => void;
1111
+ /**
1112
+ * Called when a video starts playing
1113
+ * Provides metadata about the current video
1114
+ */
1115
+ onVideoStarted?: (data: CurrentVideoData_2) => void;
1116
+ /**
1117
+ * Called on time updates during playback
1118
+ * @param seconds - Current playback position in seconds
1119
+ */
1120
+ onTimeUpdate?: (seconds: number) => void;
1121
+ /**
1122
+ * Called when playback reaches 25% of video duration
1123
+ */
1124
+ onQuartile25?: () => void;
1125
+ /**
1126
+ * Called when playback reaches 50% of video duration
903
1127
  */
904
- onPlayerEvent?: PlayerEventCallbacks_2["onPlayerEvent"];
1128
+ onQuartile50?: () => void;
1129
+ /**
1130
+ * Called when playback reaches 75% of video duration
1131
+ */
1132
+ onQuartile75?: () => void;
1133
+ /**
1134
+ * Called when transitioning to the next video in playlist
1135
+ */
1136
+ onNext?: () => void;
1137
+ /**
1138
+ * Called when transitioning to the previous video in playlist
1139
+ */
1140
+ onPrevious?: () => void;
1141
+ /**
1142
+ * Called every 10 seconds during playback
1143
+ * @param seconds - Current playback position in seconds
1144
+ */
1145
+ onProgress10s?: (seconds: number) => void;
1146
+ /**
1147
+ * Called when playback reaches 20 seconds
1148
+ * @param seconds - Current playback position (should be ~20)
1149
+ */
1150
+ onProgress20s?: (seconds: number) => void;
905
1151
  }
906
1152
 
907
1153
  /**
908
- * VPPlayerProvider component provides context for managing the VPPlayer state.
1154
+ * Interface for the imperative handle exposed by VPPlayer via ref.
1155
+ * Use this to call player methods from parent components.
909
1156
  *
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.
1157
+ * @example
1158
+ * ```tsx
1159
+ * const playerRef = useRef<VPPlayerRef>(null);
1160
+ *
1161
+ * <VPPlayer ref={playerRef} scriptId="..." videoId="..." />
1162
+ *
1163
+ * // Later:
1164
+ * playerRef.current?.seek(60);
1165
+ * playerRef.current?.play();
1166
+ * ```
914
1167
  */
915
- export declare const VPPlayerProvider: default_2.FC<{
916
- children: default_2.ReactNode;
917
- }>;
1168
+ export declare interface VPPlayerRef {
1169
+ play: () => void;
1170
+ pause: () => void;
1171
+ seek: (position: number) => void;
1172
+ forward: () => void;
1173
+ rewind: () => void;
1174
+ replay: () => void;
1175
+ mute: () => void;
1176
+ unmute: () => void;
1177
+ togglePlay: () => void;
1178
+ toggleMute: () => void;
1179
+ enterFullScreen: () => void;
1180
+ exitFullScreen: () => void;
1181
+ getPosition: () => number | null;
1182
+ getDuration: () => number | null;
1183
+ getVolume: () => number | null;
1184
+ setVolume: (volume: number) => void;
1185
+ isMuted: () => boolean;
1186
+ isPlaying: () => boolean;
1187
+ isPaused: () => boolean;
1188
+ isFullscreen: () => boolean;
1189
+ }
1190
+
1191
+ /**
1192
+ * VP Vertical Player configuration
1193
+ * Similar to VPPlayerConfig but optimized for vertical video
1194
+ */
1195
+ export declare interface VPVerticalPlayerConfig {
1196
+ projectId?: string;
1197
+ video?: VideoConfig;
1198
+ config?: PlayerSettingsConfig;
1199
+ }
918
1200
 
919
1201
  export { }