@devix-technologies/react-gjirafa-vp-player 1.0.31-beta.0 → 1.0.31-beta.3

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,67 +1,25 @@
1
1
  import { CurrentVideoData as CurrentVideoData_2 } from '../../../../../../../src/types';
2
- import { default as default_2 } from 'react';
3
2
  import { DetailedHTMLProps } from 'react';
4
3
  import { HTMLAttributes } from 'react';
5
4
  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
5
  import { RefObject } from 'react';
10
6
  import { StyledComponent } from '@emotion/styled';
11
7
  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
8
  import { VPPlayerInstance as VPPlayerInstance_2 } from '../../../../../../../src/interfaces';
15
9
  import { VPPlayerProps as VPPlayerProps_2 } from '../../../../../../../src/interfaces';
16
10
 
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
11
  /**
42
- * Builds the final VP Player configuration based on available data.
12
+ * Appends the divId query parameter to a script URL.
13
+ * This tells the managed script which DOM element to use as the player container.
43
14
  *
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
15
+ * @param url - The base script URL
16
+ * @param divId - The DOM element ID for the player container
17
+ * @returns The URL with ?divId= parameter appended
18
+ * @example
19
+ * appendDivIdToUrl('https://host.vpplayer.tech/player/ptkzurnx/vjsobqhe.js', 'my-player')
20
+ * // Returns: 'https://host.vpplayer.tech/player/ptkzurnx/vjsobqhe.js?divId=my-player'
51
21
  */
52
- export declare const buildVPPlayerConfig: ({ videoUrl, projectId, config, isVerticalPlayer, }: 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
- }
22
+ export declare const appendDivIdToUrl: (url: string, divId: string) => string;
65
23
 
66
24
  /**
67
25
  * Represents data about the currently playing video.
@@ -89,44 +47,83 @@ export declare interface CurrentVideoData {
89
47
  }
90
48
 
91
49
  /**
92
- * Default configuration object for the VP Player.
50
+ * Event callback refs interface for internal use
51
+ * Prevents stale closures in event handlers
52
+ */
53
+ export declare interface EventCallbackRefs {
54
+ onReady?: () => void;
55
+ onPlay?: () => void;
56
+ onPause?: () => void;
57
+ onResume?: () => void;
58
+ onComplete?: () => void;
59
+ onError?: (error: string) => void;
60
+ onVideoStarted?: (data: CurrentVideoData_2) => void;
61
+ onTimeUpdate?: (seconds: number) => void;
62
+ onQuartile25?: () => void;
63
+ onQuartile50?: () => void;
64
+ onQuartile75?: () => void;
65
+ onNext?: () => void;
66
+ onPrevious?: () => void;
67
+ onProgress10s?: (seconds: number) => void;
68
+ onProgress20s?: (seconds: number) => void;
69
+ }
70
+
71
+ /**
72
+ * Generates a full player DOM element ID based on provided playerId and videoId.
73
+ * Falls back to "default" if playerId is not provided.
93
74
  *
94
- * NOTE: Intentionally minimal defaults to avoid interfering with managed mode.
95
- * When using videoId + projectId (managed mode), the SDK fetches video details
96
- * from the backend. Providing empty `file` or `playlist` can break this flow.
75
+ * @param playerId - Base identifier for the player.
76
+ * @param videoId - Optional video identifier.
77
+ * @returns Full DOM element ID string.
78
+ */
79
+ export declare const generatePlayerId: (playerId?: string, videoId?: string) => string;
80
+
81
+ /**
82
+ * Generates the URL for a FULLY managed video-specific player script.
83
+ * This script auto-initializes with all config from GTech admin panel -
84
+ * NO .setup() call needed! Chapters, ads, controls, etc. are all pre-configured.
97
85
  *
98
- * @constant
99
- * @type {VPPlayerConfig}
100
- * @see {@link https://vp.gjirafa.tech/documentation/docs/web-player/setup-the-player/configuration}
86
+ * @param {string} scriptId - The player script ID (e.g., 'ptkzurnx').
87
+ * @param {string} videoId - The video ID (e.g., 'vjsobqhe').
88
+ * @returns {string} - The complete URL for the fully managed player script.
89
+ * @example
90
+ * // Returns: https://host.vpplayer.tech/player/ptkzurnx/vjsobqhe.js
91
+ * getFullyManagedPlayerScriptUrl('ptkzurnx', 'vjsobqhe')
101
92
  */
102
- export declare const defaultVPPlayerConfig: VPPlayerConfig;
93
+ export declare const getFullyManagedPlayerScriptUrl: (scriptId: string, videoId: string) => string;
103
94
 
104
- /** URL for the Elephants Dream video */
105
- export declare const ELEPHANTS_DREAM_URL = "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4";
95
+ /**
96
+ * Generates the URL for loading a managed VP Player script (Web Player).
97
+ * This script requires calling .setup() with your config.
98
+ * @param {string} scriptId - The unique script ID (e.g., 'ptkzurly').
99
+ * @returns {string} - The complete URL for the managed player script.
100
+ */
101
+ export declare const getManagedPlayerScriptUrl: (scriptId: string) => string;
106
102
 
107
103
  /**
108
- * Extracts the video ID from a given VP Player script URL.
109
- *
110
- * IMPORTANT: Only extracts from HORIZONTAL player URLs.
111
- * Vertical player URLs contain a player script ID, NOT a video ID.
112
- * - Horizontal: ${VP_PLAYER_BASE_URL}/player/{version}/{videoId}.js -> extracts videoId
113
- * - Vertical: ${VP_PLAYER_BASE_URL}/vertical-player/{scriptId}.js -> returns undefined
114
- *
115
- * @function
116
- * @param {string} [scriptUrl] - The script URL containing the video ID.
117
- * @returns {string | undefined} The extracted video ID, or `undefined` if not found or if vertical player.
104
+ * Generates the URL for loading the standard VP Player script by version.
105
+ * @param {string} playerVersion - The version of the VP Player script (e.g., 'latest', 'v2.1.1').
106
+ * @returns {string} - The complete URL for the player script.
107
+ */
108
+ export declare const getPlayerScriptUrl: (playerVersion: string) => string;
109
+
110
+ /**
111
+ * Generates the URL for loading a vertical VP Player script.
112
+ * @param {string} scriptId - The unique script ID (e.g., 'rbqcdwzlg').
113
+ * @returns {string} - The complete URL for the vertical player script.
118
114
  */
119
- export declare const extractVideoId: (scriptUrl?: string) => string | undefined;
115
+ export declare const getVerticalPlayerScriptUrl: (scriptId: string) => string;
120
116
 
121
117
  /**
122
- * Generates an ad configuration for VP Player based on provided parameters.
123
- * @param breakType - The type of ad break (e.g., "preroll", "postroll", "midroll").
124
- * @param adTagUrls - Array of ad tag URLs to use for the ad break.
125
- * @param breakTimingType - The timing type for the ad break (e.g., "time", "percentage", "playlist").
126
- * @param breakTimingValue - The timing value for the ad break (e.g., 0 for immediate, 2 for playlist index).
127
- * @returns A partial VPPlayerConfig with the ad configuration.
118
+ * Manual playlist configuration
119
+ * Used when you want to provide your own videos array instead of using GTech admin playlists
128
120
  */
129
- export declare const getAdConfig: (breakType: "preroll" | "postroll" | "midroll", adTagUrls: string[], breakTimingType?: "time" | "percentage" | "playlist", breakTimingValue?: number) => Partial<VPPlayerConfig_3>;
121
+ export declare interface ManualPlaylistConfig {
122
+ /** Array of videos to play */
123
+ videos: PlaylistVideoItem[];
124
+ /** Starting video index (0-based) */
125
+ startIndex?: number;
126
+ }
130
127
 
131
128
  /**
132
129
  * Styled component for the full-screen overlay when the player is active.
@@ -141,12 +138,6 @@ as?: React.ElementType;
141
138
  className?: string;
142
139
  }, DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
143
140
 
144
- /** URL for the Pexels thumbnail */
145
- export declare const PEXELS_THUMBNAIL_URL = "https://images.pexels.com/videos/4678261/pexels-photo-4678261.jpeg?auto=compress&cs=tinysrgb&w=600";
146
-
147
- /** URL for the Pexels vertical video */
148
- export declare const PEXELS_VERTICAL_VIDEO_URL = "https://videos.pexels.com/video-files/4678261/4678261-hd_1080_1920_25fps.mp4";
149
-
150
141
  /**
151
142
  * Styled component for the video player container.
152
143
  *
@@ -226,47 +217,6 @@ export declare interface PlayerObject {
226
217
  progress?: number;
227
218
  }
228
219
 
229
- /**
230
- * Interface defining the parameters for configuring the VP Player instance.
231
- *
232
- * @interface
233
- */
234
- export declare interface PlayerParams {
235
- playerId: string;
236
- config?: Partial<VPPlayerConfig>;
237
- videoId?: string;
238
- projectId?: string;
239
- videoUrl?: string;
240
- playlistId?: string;
241
- scriptUrl?: string;
242
- version?: string | null;
243
- thumbnailUrl?: string;
244
- isReels?: boolean;
245
- hiddenClasses?: string[];
246
- className?: string;
247
- onPlaylistData?: (videos: PlaylistItem_2[]) => void;
248
- }
249
-
250
- /**
251
- * Interface defining the parameters for initializing the VPPlayer.
252
- *
253
- * @interface PlayerParams
254
- */
255
- declare interface PlayerParams_2 {
256
- playerId?: string;
257
- videoId?: string;
258
- projectId?: string;
259
- videoUrl?: string;
260
- playlistId?: string;
261
- scriptUrl?: string;
262
- version?: string | null;
263
- config?: VPPlayerProps_2["config"];
264
- thumbnailUrl?: string;
265
- isReels?: boolean;
266
- hiddenClasses?: string[];
267
- className?: string;
268
- }
269
-
270
220
  /**
271
221
  * Tracking metadata for analytics (available in v1.0.23+)
272
222
  */
@@ -322,19 +272,35 @@ export declare interface PlaylistItem {
322
272
  }
323
273
 
324
274
  /**
325
- * Hook for accessing the VPPlayer context.
326
- *
327
- * @function
328
- * @throws {Error} If used outside of the VPPlayerProvider.
329
- * @returns {VPPlayerContextType} The VPPlayer context.
275
+ * Video item for manual playlist
330
276
  */
331
- export declare const useVPPlayer: () => VPPlayerContextType_2;
277
+ export declare interface PlaylistVideoItem {
278
+ /** Unique video identifier */
279
+ videoId: string;
280
+ /** Video title */
281
+ title: string;
282
+ /** Video file URL (mp4, m3u8, etc.) */
283
+ file: string;
284
+ /** Alternative: HLS URL */
285
+ hlsUrl?: string;
286
+ /** Thumbnail image URL */
287
+ thumbnailUrl?: string;
288
+ /** Alternative: Thumbnail URL */
289
+ thumbnail?: string;
290
+ /** Video duration in seconds */
291
+ duration?: number;
292
+ }
332
293
 
333
294
  /**
334
- * Custom hook to manage VP Player logic.
335
- * Uses native SDK events instead of manual progress tracking.
295
+ * VP Player logic hook
296
+ *
297
+ * Supports two modes:
298
+ * 1. **Auto-init mode** (default): Load managed script that auto-initializes with GTech admin config
299
+ * 2. **Manual playlist mode**: Build config and call setup() with custom videos array
300
+ *
301
+ * The manual playlist mode is required for vertical player when supplying your own videos.
336
302
  */
337
- export declare const useVPPlayerLogic: ({ playerId, videoId: propVideoId, version, videoUrl, projectId, playlistId, scriptUrl, config, isReels, onPlaylistData, onVideoStarted, onPlayerStart, onPlayerPlay, onPlayerPause, onPlayerResume, onPlayerEnd, onPlayerProgressEvery10Seconds, onPlayerProgressAt20Seconds, onPlayerQuartile25, onPlayerQuartile50, onPlayerQuartile75, onPlayerNext, onPlayerPrevious, onPlayerEvent, }: VPPlayerProps_2) => {
303
+ export declare const useVPPlayerLogic: ({ scriptId, videoId, scriptUrl, projectId, playlist, playerId, isVertical, isReels, onReady, onPlay, onPause, onResume, onComplete, onError, onVideoStarted, onTimeUpdate, onQuartile25, onQuartile50, onQuartile75, onNext, onPrevious, onProgress10s, onProgress20s, }: VPPlayerProps_2) => {
338
304
  playerRef: RefObject<HTMLDivElement | null>;
339
305
  playerInstanceRef: RefObject<VPPlayerInstance_2 | null>;
340
306
  isScriptLoaded: boolean;
@@ -392,50 +358,85 @@ export declare interface VideoDataResult {
392
358
  }
393
359
 
394
360
  /**
395
- * Video Player Component for rendering a video player with overlay and responsive behavior.
396
- * Handles initialization of the player and displays loading/error states.
361
+ * Base URL for the VP Player host.
362
+ */
363
+ export declare const VP_PLAYER_BASE_URL = "https://host.vpplayer.tech";
364
+
365
+ /**
366
+ * VP Player Component (v2.0.0)
397
367
  *
398
- * @function
399
- * @param {VPPlayerProps} props - The properties for configuring the video player.
400
- * @param {string} props.playerId - Unique identifier for the player instance.
401
- * @param {string} [props.videoId] - ID of the video to be played.
402
- * @param {string} [props.version] - Version of the player.
403
- * @param {string} [props.videoUrl] - Direct video URL (bypasses API calls).
404
- * @param {string} [props.projectId] - Project ID associated with the video.
405
- * @param {string} [props.playlistId] - Playlist ID if playing a collection of videos.
406
- * @param {string} [props.scriptUrl] - URL of the video player script.
407
- * @param {object} [props.config={}] - Configuration settings for the player.
408
- * @param {boolean} [props.isReels=false] - Determines if the player should behave as a short-video reel.
409
- * @param {string[]} [props.hiddenClasses=[]] - CSS classes to hide player elements.
410
- * @param {function} [props.onClose] - Callback triggered when the player is closed.
411
- * @param {boolean} [props.isPlayerVisible=false] - Controls the initial visibility of the player.
412
- * @param {string} [props.className] - CSS class name for additional styling.
413
- * @param {function} [props.onPlaylistData] - Callback triggered when the playlist data is loaded.
414
- * @param {function} [props.onVideoStarted] - Callback triggered when the video starts playing.
415
- * @param {object} [props.trackingMetadata] - Video metadata for tracking/analytics callbacks.
416
- * @param {function} [props.onPlayerStart] - Callback triggered when the player starts playing.
417
- * @param {function} [props.onPlayerPlay] - Callback triggered when the player plays.
418
- * @param {function} [props.onPlayerPause] - Callback triggered when the player pauses.
419
- * @param {function} [props.onPlayerResume] - Callback triggered when the player resumes.
420
- * @param {function} [props.onPlayerEnd] - Callback triggered when the player ends.
421
- * @param {function} [props.onPlayerProgressEvery10Seconds] - Callback triggered every 10 seconds.
422
- * @param {function} [props.onPlayerProgressAt20Seconds] - Callback triggered at 20 seconds.
423
- * @param {function} [props.onPlayerQuartile25] - Callback triggered at 25% quartile.
424
- * @param {function} [props.onPlayerQuartile50] - Callback triggered at 50% quartile.
425
- * @param {function} [props.onPlayerQuartile75] - Callback triggered at 75% quartile.
426
- * @param {function} [props.onPlayerNext] - Callback triggered when the player goes to the next video.
427
- * @param {function} [props.onPlayerEvent] - Callback triggered for all events.
428
- * @returns {JSX.Element} The rendered video player component.
429
- */
430
- export declare const VPPlayer: ({ playerId, videoId, version, videoUrl, projectId, playlistId, scriptUrl, config, isReels, hiddenClasses, onClose, className, onPlaylistData, onVideoStarted, trackingMetadata, onPlayerStart, onPlayerPlay, onPlayerPause, onPlayerResume, onPlayerEnd, onPlayerProgressEvery10Seconds, onPlayerProgressAt20Seconds, onPlayerQuartile25, onPlayerQuartile50, onPlayerQuartile75, onPlayerNext, onPlayerPrevious, onPlayerEvent, }: VPPlayerProps_2 & {
431
- className?: string;
432
- }) => JSX.Element;
368
+ * A thin React wrapper for the GTech VP Player.
369
+ * All configuration is managed through the GTech admin panel -
370
+ * this wrapper just provides a DOM container, loads the script, and exposes events.
371
+ *
372
+ * ## Basic Usage
373
+ *
374
+ * ```tsx
375
+ * // Using scriptId + videoId (recommended)
376
+ * <VPPlayer
377
+ * scriptId="ptkzurnx"
378
+ * videoId="vjsobqhe"
379
+ * onPlay={() => console.log('Playing!')}
380
+ * />
381
+ *
382
+ * // OR using full script URL
383
+ * <VPPlayer
384
+ * scriptUrl="https://host.vpplayer.tech/player/ptkzurnx/vjsobqhe.js"
385
+ * onPlay={() => console.log('Playing!')}
386
+ * />
387
+ * ```
388
+ *
389
+ * ## Manual Playlist Mode (Vertical Player)
390
+ *
391
+ * For vertical player with custom videos array:
392
+ *
393
+ * ```tsx
394
+ * <VPPlayer
395
+ * scriptId="rbqcdwzlg"
396
+ * projectId="agmipnzb"
397
+ * isVertical={true}
398
+ * playlist={{
399
+ * videos: [
400
+ * { videoId: "1", title: "Video 1", file: "https://...mp4", thumbnailUrl: "...", duration: 120 },
401
+ * { videoId: "2", title: "Video 2", file: "https://...mp4", thumbnailUrl: "...", duration: 150 },
402
+ * ],
403
+ * startIndex: 0,
404
+ * }}
405
+ * onNext={() => console.log('Next video')}
406
+ * />
407
+ * ```
408
+ *
409
+ * ## Reels Mode
410
+ *
411
+ * For TikTok-style vertical videos with overlay:
412
+ *
413
+ * ```tsx
414
+ * <VPPlayer
415
+ * scriptId="rbqcdwzlg"
416
+ * videoId="vjsobqhe"
417
+ * isReels={true}
418
+ * thumbnailUrl="https://example.com/thumb.jpg"
419
+ * onClose={() => console.log('Closed')}
420
+ * />
421
+ * ```
422
+ *
423
+ * @param props - VPPlayer configuration props
424
+ */
425
+ export declare const VPPlayer: ({ scriptId, videoId, scriptUrl, projectId, playlist, playerId, isVertical, isReels, thumbnailUrl, onClose, className, hiddenClasses, onReady, onPlay, onPause, onResume, onComplete, onError, onVideoStarted, onTimeUpdate, onQuartile25, onQuartile50, onQuartile75, onNext, onPrevious, onProgress10s, onProgress20s, }: VPPlayerProps_2) => JSX.Element;
433
426
 
434
427
  /**
435
- * Interface describing the advertising configuration options for the VP Player.
428
+ * VP Player Configuration Types (v2.0.0)
429
+ *
430
+ * NOTE: In v2.0.0, configuration is managed through the GTech admin panel.
431
+ * These types are kept for reference only - the React wrapper does NOT
432
+ * pass configuration to the SDK. The managed script auto-initializes
433
+ * with all settings from the admin panel.
436
434
  *
437
- * @interface
438
- * @see {@link https://vp.gjirafa.tech/documentation/docs/web-player/setup-the-player/advertising}
435
+ * @see {@link https://vp.gjirafa.tech/documentation/docs/web-player/setup-the-player/configuration}
436
+ */
437
+ /**
438
+ * Advertising configuration interface (reference only)
439
+ * Configured through GTech admin panel
439
440
  */
440
441
  export declare interface VPPlayerAdsConfig {
441
442
  skipAd?: {
@@ -445,332 +446,12 @@ export declare interface VPPlayerAdsConfig {
445
446
  vmap?: string;
446
447
  VPAIDmode?: string;
447
448
  enableProgrammability?: boolean;
448
- functions?: Array<{
449
- isDynamicKey: boolean;
450
- isDynamicValue: boolean;
451
- key: string;
452
- order: number;
453
- value: string;
454
- }>;
455
- bidding?: boolean;
456
- afterMidrollBacktrack?: {
457
- state: boolean;
458
- seconds: number;
459
- };
460
449
  adBreaks?: Array<{
461
450
  adTagUrl: string[];
462
- breakType?: 'preroll' | 'midroll' | 'postroll';
463
- breakTimingType?: 'time' | 'percentage' | 'playlist';
451
+ breakType?: "preroll" | "midroll" | "postroll";
452
+ breakTimingType?: "time" | "percentage" | "playlist";
464
453
  breakTimingValue?: number;
465
- schedule?: {
466
- type?: 'CUSTOM' | 'RECURRING';
467
- ranges?: Array<{
468
- startTime?: number;
469
- endTime?: number;
470
- count?: number;
471
- breaks?: number[];
472
- }>;
473
- algorithm?: 'PASSIVE' | 'AGGRESSIVE' | 'SIMILAR_DISTANCE' | 'CUSTOM';
474
- protectFirst?: number;
475
- protectLast?: number;
476
- occurEvery?: number;
477
- liveCount?: number;
478
- };
479
454
  }>;
480
- bidders?: Array<{
481
- name: string;
482
- params?: Array<{
483
- paramName?: string;
484
- paramType?: string;
485
- paramValue?: string;
486
- }>;
487
- }>;
488
- adsRequireInteraction?: boolean;
489
- }
490
-
491
- /**
492
- * Interface defining the configuration options for the VP Player.
493
- *
494
- * @interface
495
- * @see {@link https://vp.gjirafa.tech/documentation/docs/web-player/setup-the-player/configuration}
496
- * @see {@link https://vp.gjirafa.tech/documentation/docs/web-player/setup-the-player/playing}
497
- * @see {@link https://vp.gjirafa.tech/documentation/docs/web-player/setup-the-player/advertising}
498
- * @see {@link https://vp.gjirafa.tech/documentation/docs/web-player/setup-the-player/styling}
499
- * @see {@link https://vp.gjirafa.tech/documentation/docs/web-player/setup-the-player/localization}
500
- * @see {@link https://vp.gjirafa.tech/documentation/docs/web-player/setup-the-player/full-configuration}
501
- */
502
- export declare interface VPPlayerConfig {
503
- projectId?: string;
504
- videoId?: string;
505
- categoryName?: string;
506
- gemiusIdentifier?: string;
507
- typology?: string;
508
- video: {
509
- videoId?: string;
510
- ads?: VPPlayerAdsConfig;
511
- advertising?: boolean;
512
- videoLocking?: {
513
- isEnabled: boolean;
514
- type: string;
515
- value: number;
516
- };
517
- file?: string;
518
- title?: string;
519
- description?: string;
520
- publishDate?: string;
521
- duration?: number;
522
- preload?: string;
523
- thumbnail?: string;
524
- filmstrip?: string;
525
- author?: string;
526
- source?: string;
527
- tags?: string[];
528
- tracks?: Array<{
529
- file: string;
530
- label: string;
531
- kind: string;
532
- default?: boolean;
533
- }>;
534
- playlist?: {
535
- state?: boolean;
536
- playlistId?: string;
537
- playlistVideoIndex?: number;
538
- videos?: Array<{
539
- videoId: string;
540
- title: string;
541
- thumbnailUrl?: string;
542
- duration?: number;
543
- file?: string;
544
- hlsUrl?: string;
545
- }>;
546
- };
547
- };
548
- config: {
549
- adAnnouncement?: {
550
- state?: boolean;
551
- timeBeforeAd?: number;
552
- };
553
- autostartOnLoad?: {
554
- state?: boolean;
555
- onMobile?: boolean;
556
- onData?: boolean;
557
- };
558
- adsRequireInteraction?: boolean;
559
- autoplay?: boolean;
560
- pauseOtherVideos?: boolean;
561
- focusOnAutostart?: boolean;
562
- muted?: boolean;
563
- loop?: boolean;
564
- size?: {
565
- sizeType?: string;
566
- aspectRatio?: string;
567
- width?: number | string;
568
- height?: number | string;
569
- };
570
- showRelatedOnPause?: {
571
- state?: boolean;
572
- onMobile?: boolean;
573
- from?: number;
574
- };
575
- float?: {
576
- state: boolean;
577
- onMobile: boolean;
578
- position: string;
579
- dismissible: boolean;
580
- requiresInteraction: boolean;
581
- toVideoThreshold: number;
582
- toFloatThreshold: number;
583
- style: {
584
- width: number;
585
- border: string;
586
- };
587
- };
588
- controls?: {
589
- theaterButton?: boolean;
590
- settingsButton?: boolean;
591
- chromecastButton?: boolean;
592
- nextButton?: boolean;
593
- fullscreenButton?: boolean;
594
- airplayButton?: boolean;
595
- bigPlayButton?: boolean;
596
- autopausePlayButton?: boolean;
597
- pictureInPictureButton?: boolean;
598
- relatedButton?: boolean;
599
- volumeButton?: boolean;
600
- shareButton?: boolean;
601
- subtitlesButton?: boolean;
602
- showCaptions?: boolean;
603
- };
604
- logo?: {
605
- state?: boolean;
606
- file?: string;
607
- position?: string;
608
- defaultOpacity?: number;
609
- inactiveOpacity?: number;
610
- onClickURL?: string;
611
- };
612
- skin?: {
613
- controlBar?: {
614
- background?: string;
615
- spread?: "solid" | "gradient";
616
- gradientMidPoint?: number;
617
- text?: string;
618
- icons?: {
619
- default?: string;
620
- hover?: string;
621
- };
622
- timeslider?: {
623
- progress?: string;
624
- rail?: string;
625
- buffer?: string;
626
- dragger?: string;
627
- };
628
- timesliderOnAd?: {
629
- progress?: string;
630
- rail?: string;
631
- buffer?: string;
632
- dragger?: string;
633
- };
634
- volume?: {
635
- dragger?: string;
636
- progress?: string;
637
- rail?: string;
638
- notifier?: string;
639
- };
640
- };
641
- menus?: {
642
- background?: {
643
- default?: string;
644
- hover?: string;
645
- };
646
- links?: {
647
- default?: string;
648
- hover?: string;
649
- };
650
- autoplay?: {
651
- autoplayOn?: string;
652
- autoplayOff?: string;
653
- };
654
- };
655
- nextVideo?: {
656
- background?: string;
657
- text?: string;
658
- timeslider?: {
659
- rail?: string;
660
- progress?: string;
661
- };
662
- icons?: {
663
- play?: {
664
- default?: string;
665
- hover?: string;
666
- };
667
- close?: string;
668
- };
669
- };
670
- playlist?: {
671
- background?: string;
672
- text?: string;
673
- icons?: {
674
- arrows?: {
675
- active?: string;
676
- inactive?: string;
677
- };
678
- close?: string;
679
- };
680
- card?: {
681
- background?: string;
682
- title?: string;
683
- duration?: {
684
- text?: string;
685
- background?: string;
686
- };
687
- icons?: {
688
- play?: {
689
- default?: string;
690
- hover?: string;
691
- };
692
- };
693
- };
694
- };
695
- };
696
- lang?: {
697
- locale?: string;
698
- controls?: {
699
- play?: string;
700
- pause?: string;
701
- next?: string;
702
- replay?: string;
703
- volume?: string;
704
- mute?: string;
705
- unmute?: string;
706
- settings?: string;
707
- theater?: string;
708
- fullscreen?: string;
709
- chromecast?: string;
710
- airplay?: string;
711
- pictureInPicture?: string;
712
- related?: string;
713
- skipIntro?: string;
714
- skipAd?: string;
715
- playlistTitle?: string;
716
- upNext?: string;
717
- live?: string;
718
- continueAfterPause?: string;
719
- };
720
- settings?: {
721
- quality?: string;
722
- subtitles?: string;
723
- autoplay?: string;
724
- playbackRate?: string;
725
- auto?: string;
726
- off?: string;
727
- normal?: string;
728
- share?: string;
729
- };
730
- ads?: {
731
- ad?: string;
732
- skip?: string;
733
- skipIn?: string;
734
- visit?: string;
735
- info?: string;
736
- simultaneousAds?: string;
737
- adAnnouncement?: string;
738
- };
739
- messages?: {
740
- playbackErrorTitle?: string;
741
- playbackErrorDescription?: string;
742
- geoBlockedTitle?: string;
743
- geoBlockedDescription?: string;
744
- streamInterruptedTitle?: string;
745
- streamInterruptedDescription?: string;
746
- };
747
- };
748
- ads?: VPPlayerAdsConfig;
749
- };
750
- }
751
-
752
- /**
753
- * Interface for the VP Player context, providing methods and state for controlling the player.
754
- *
755
- * @interface
756
- */
757
- export declare interface VPPlayerContextType {
758
- showPlayer: (params: PlayerParams) => void;
759
- hidePlayer: () => void;
760
- isPlayerVisible: boolean;
761
- playerParams: PlayerParams | null;
762
- }
763
-
764
- /**
765
- * Interface defining the context for VPPlayer.
766
- *
767
- * @interface VPPlayerContextType
768
- */
769
- declare interface VPPlayerContextType_2 {
770
- showPlayer: (params: PlayerParams_2) => void;
771
- hidePlayer: () => void;
772
- isPlayerVisible: boolean;
773
- playerParams: PlayerParams_2 | null;
774
455
  }
775
456
 
776
457
  /**
@@ -778,10 +459,10 @@ declare interface VPPlayerContextType_2 {
778
459
  * Based on VP Player API Reference: https://vp.gjirafa.tech/documentation/docs/web-player/api-reference
779
460
  * And VP Vertical Player API Reference: https://vp.gjirafa.tech/documentation/docs/vertical-player/api-reference
780
461
  *
781
- * @interface
462
+ * @interface VPPlayerInstance
782
463
  */
783
464
  export declare interface VPPlayerInstance {
784
- setup: (config: VPPlayerConfig) => void;
465
+ setup: (config: unknown) => void;
785
466
  destroy?: () => void;
786
467
  play?: () => void;
787
468
  pause?: () => void;
@@ -810,7 +491,7 @@ export declare interface VPPlayerInstance {
810
491
  getVolume?: () => number;
811
492
  getContainer?: () => HTMLElement;
812
493
  getDuration?: () => number;
813
- getConfig?: () => VPPlayerConfig;
494
+ getConfig?: () => unknown;
814
495
  getQualityLevels?: () => unknown[];
815
496
  getCurrentQuality?: () => number;
816
497
  checkViewability?: () => boolean;
@@ -838,60 +519,154 @@ export declare interface VPPlayerInstance {
838
519
  }
839
520
 
840
521
  /**
841
- * Interface defining the properties for the VP Player component.
522
+ * Simplified props interface for VPPlayer v2.0.0
523
+ *
524
+ * The wrapper is now a thin bridge to the GTech JS player.
525
+ * All configuration is managed through the GTech admin panel.
842
526
  *
843
- * @interface
527
+ * @interface VPPlayerProps
844
528
  */
845
529
  export declare interface VPPlayerProps {
846
- playerId: string;
847
- config?: Partial<VPPlayerConfig>;
530
+ /**
531
+ * GTech script ID (e.g., 'ptkzurnx')
532
+ * Used with videoId to build the fully managed script URL
533
+ */
534
+ scriptId?: string;
535
+ /**
536
+ * GTech video ID (e.g., 'vjsobqhe')
537
+ * Used with scriptId to build the fully managed script URL
538
+ */
848
539
  videoId?: string;
849
- projectId?: string;
850
- videoUrl?: string;
851
- playlistId?: string;
540
+ /**
541
+ * Full managed script URL (alternative to scriptId + videoId)
542
+ * @example "https://host.vpplayer.tech/player/ptkzurnx/vjsobqhe.js"
543
+ */
852
544
  scriptUrl?: string;
853
- version?: string | null;
545
+ /**
546
+ * GTech project ID (required for manual playlist mode)
547
+ */
548
+ projectId?: string;
549
+ /**
550
+ * Manual playlist configuration - provide your own videos array.
551
+ * When provided, the wrapper will call setup() with the built config
552
+ * instead of relying on auto-initialization.
553
+ *
554
+ * IMPORTANT: This is required for vertical player when you want to
555
+ * supply your own videos (not using GTech admin playlists).
556
+ *
557
+ * @example
558
+ * ```tsx
559
+ * <VPPlayer
560
+ * scriptId="rbqcdwzlg"
561
+ * projectId="agmipnzb"
562
+ * isVertical={true}
563
+ * playlist={{
564
+ * videos: [
565
+ * { videoId: "1", title: "Video 1", file: "https://...mp4", thumbnailUrl: "...", duration: 120 },
566
+ * { videoId: "2", title: "Video 2", file: "https://...mp4", thumbnailUrl: "...", duration: 150 },
567
+ * ],
568
+ * startIndex: 0,
569
+ * }}
570
+ * />
571
+ * ```
572
+ */
573
+ playlist?: ManualPlaylistConfig;
574
+ /**
575
+ * Custom container ID for the player div
576
+ * Auto-generated if not provided
577
+ */
578
+ playerId?: string;
579
+ /**
580
+ * Use vertical player script URL builder
581
+ * When true, uses /vertical-player/{scriptId}.js pattern
582
+ */
583
+ isVertical?: boolean;
584
+ /**
585
+ * Enable Reels/TikTok-style overlay mode
586
+ * Shows thumbnail first, then fullscreen overlay when clicked
587
+ */
854
588
  isReels?: boolean;
589
+ /**
590
+ * Thumbnail URL for Reels mode
591
+ */
855
592
  thumbnailUrl?: string;
593
+ /**
594
+ * Callback when Reels overlay is closed
595
+ */
856
596
  onClose?: () => void;
857
- hiddenClasses?: string[];
858
- isPlayerVisible?: boolean;
597
+ /**
598
+ * Additional CSS class name for the player container
599
+ */
859
600
  className?: string;
860
- onPlaylistData?: (videos: PlaylistItem_2[]) => void;
861
- onVideoStarted?: (videoData: CurrentVideoData_2) => void;
862
601
  /**
863
- * Video metadata for tracking/analytics callbacks
602
+ * CSS classes to hide specific SDK elements
603
+ * @example ['vp-share-button', 'vp-logo']
864
604
  */
865
- trackingMetadata?: PlayerTrackingMetadata_2;
866
- onPlayerStart?: PlayerEventCallbacks_2["onPlayerStart"];
867
- onPlayerPlay?: PlayerEventCallbacks_2["onPlayerPlay"];
868
- onPlayerPause?: PlayerEventCallbacks_2["onPlayerPause"];
869
- onPlayerResume?: PlayerEventCallbacks_2["onPlayerResume"];
870
- onPlayerEnd?: PlayerEventCallbacks_2["onPlayerEnd"];
871
- onPlayerProgressEvery10Seconds?: PlayerEventCallbacks_2["onPlayerProgressEvery10Seconds"];
872
- onPlayerProgressAt20Seconds?: PlayerEventCallbacks_2["onPlayerProgressAt20Seconds"];
873
- onPlayerQuartile25?: PlayerEventCallbacks_2["onPlayerQuartile25"];
874
- onPlayerQuartile50?: PlayerEventCallbacks_2["onPlayerQuartile50"];
875
- onPlayerQuartile75?: PlayerEventCallbacks_2["onPlayerQuartile75"];
876
- onPlayerNext?: PlayerEventCallbacks_2["onPlayerNext"];
877
- onPlayerPrevious?: PlayerEventCallbacks_2["onPlayerPrevious"];
605
+ hiddenClasses?: string[];
878
606
  /**
879
- * Universal callback for all events - called in addition to specific callbacks
880
- * this gives us all event in one callback
607
+ * Called when the player is ready/initialized
881
608
  */
882
- onPlayerEvent?: PlayerEventCallbacks_2["onPlayerEvent"];
609
+ onReady?: () => void;
610
+ /**
611
+ * Called when playback starts
612
+ */
613
+ onPlay?: () => void;
614
+ /**
615
+ * Called when playback is paused
616
+ */
617
+ onPause?: () => void;
618
+ /**
619
+ * Called when playback resumes after pause
620
+ */
621
+ onResume?: () => void;
622
+ /**
623
+ * Called when video playback completes
624
+ */
625
+ onComplete?: () => void;
626
+ /**
627
+ * Called when an error occurs
628
+ */
629
+ onError?: (error: string) => void;
630
+ /**
631
+ * Called when a video starts playing
632
+ * Provides metadata about the current video
633
+ */
634
+ onVideoStarted?: (data: CurrentVideoData_2) => void;
635
+ /**
636
+ * Called on time updates during playback
637
+ * @param seconds - Current playback position in seconds
638
+ */
639
+ onTimeUpdate?: (seconds: number) => void;
640
+ /**
641
+ * Called when playback reaches 25% of video duration
642
+ */
643
+ onQuartile25?: () => void;
644
+ /**
645
+ * Called when playback reaches 50% of video duration
646
+ */
647
+ onQuartile50?: () => void;
648
+ /**
649
+ * Called when playback reaches 75% of video duration
650
+ */
651
+ onQuartile75?: () => void;
652
+ /**
653
+ * Called when transitioning to the next video in playlist
654
+ */
655
+ onNext?: () => void;
656
+ /**
657
+ * Called when transitioning to the previous video in playlist
658
+ */
659
+ onPrevious?: () => void;
660
+ /**
661
+ * Called every 10 seconds during playback
662
+ * @param seconds - Current playback position in seconds
663
+ */
664
+ onProgress10s?: (seconds: number) => void;
665
+ /**
666
+ * Called when playback reaches 20 seconds
667
+ * @param seconds - Current playback position (should be ~20)
668
+ */
669
+ onProgress20s?: (seconds: number) => void;
883
670
  }
884
671
 
885
- /**
886
- * VPPlayerProvider component provides context for managing the VPPlayer state.
887
- *
888
- * @function
889
- * @param {Object} props - The component props.
890
- * @param {React.ReactNode} props.children - The child components.
891
- * @returns {JSX.Element} The provider component for VPPlayer.
892
- */
893
- export declare const VPPlayerProvider: default_2.FC<{
894
- children: default_2.ReactNode;
895
- }>;
896
-
897
672
  export { }