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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,12 +1,86 @@
1
1
  import { CurrentVideoData as CurrentVideoData_2 } from '../../../../../../../src/types';
2
2
  import { DetailedHTMLProps } from 'react';
3
+ import { ForwardRefExoticComponent } from 'react';
3
4
  import { HTMLAttributes } from 'react';
4
- import { JSX } from 'react/jsx-runtime';
5
+ import { RefAttributes } from 'react';
5
6
  import { RefObject } from 'react';
6
7
  import { StyledComponent } from '@emotion/styled';
7
8
  import { Theme } from '@emotion/react';
8
9
  import { VPPlayerInstance as VPPlayerInstance_2 } from '../../../../../../../src/interfaces';
9
10
  import { VPPlayerProps as VPPlayerProps_2 } from '../../../../../../../src/interfaces';
11
+ import { VPPlayerRef as VPPlayerRef_2 } from '../../../../../../../src/interfaces';
12
+
13
+ /**
14
+ * Ad announcement configuration
15
+ */
16
+ export declare interface AdAnnouncementConfig {
17
+ state: boolean;
18
+ timeBeforeAd: number;
19
+ }
20
+
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
+ }
30
+
31
+ /**
32
+ * Ad function configuration
33
+ */
34
+ export declare interface AdFunction {
35
+ isDynamicKey: boolean;
36
+ isDynamicValue: boolean;
37
+ key: string;
38
+ order: number;
39
+ value: string;
40
+ }
41
+
42
+ /**
43
+ * Advertising configuration
44
+ */
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
+ }
56
+
57
+ /**
58
+ * Ad skip configuration
59
+ */
60
+ export declare interface AdSkipConfig {
61
+ state: boolean;
62
+ skipFrom: number;
63
+ }
64
+
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
+ }
76
+
77
+ /**
78
+ * After midroll backtrack configuration
79
+ */
80
+ export declare interface AfterMidrollBacktrack {
81
+ state: boolean;
82
+ seconds: number;
83
+ }
10
84
 
11
85
  /**
12
86
  * Appends the divId query parameter to a script URL.
@@ -21,6 +95,118 @@ import { VPPlayerProps as VPPlayerProps_2 } from '../../../../../../../src/inter
21
95
  */
22
96
  export declare const appendDivIdToUrl: (url: string, divId: string) => string;
23
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;
208
+ }
209
+
24
210
  /**
25
211
  * Represents data about the currently playing video.
26
212
  * Used in onVideoStarted callback.
@@ -46,6 +232,20 @@ export declare interface CurrentVideoData {
46
232
  description?: string;
47
233
  }
48
234
 
235
+ /**
236
+ * VP Player Configuration Types
237
+ *
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
244
+ */
245
+ export declare type DeepPartial<T> = T extends object ? {
246
+ [P in keyof T]?: DeepPartial<T[P]>;
247
+ } : T;
248
+
49
249
  /**
50
250
  * Event callback refs interface for internal use
51
251
  * Prevents stale closures in event handlers
@@ -68,6 +268,28 @@ export declare interface EventCallbackRefs {
68
268
  onProgress20s?: (seconds: number) => void;
69
269
  }
70
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
+ }
284
+
285
+ /**
286
+ * Float style configuration
287
+ */
288
+ export declare interface FloatStyleConfig {
289
+ width: number;
290
+ border?: string;
291
+ }
292
+
71
293
  /**
72
294
  * Generates a full player DOM element ID based on provided playerId and videoId.
73
295
  * Falls back to "default" if playerId is not provided.
@@ -115,14 +337,74 @@ export declare const getPlayerScriptUrl: (playerVersion: string) => string;
115
337
  export declare const getVerticalPlayerScriptUrl: (scriptId: string) => string;
116
338
 
117
339
  /**
118
- * Manual playlist configuration
119
- * Used when you want to provide your own videos array instead of using GTech admin playlists
340
+ * Icons skin configuration
120
341
  */
121
- export declare interface ManualPlaylistConfig {
122
- /** Array of videos to play */
123
- videos: PlaylistVideoItem[];
124
- /** Starting video index (0-based) */
125
- startIndex?: number;
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
+ };
126
408
  }
127
409
 
128
410
  /**
@@ -217,6 +499,36 @@ export declare interface PlayerObject {
217
499
  progress?: number;
218
500
  }
219
501
 
502
+ /**
503
+ * Player settings configuration (the `config` object in VP Player)
504
+ */
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;
530
+ }
531
+
220
532
  /**
221
533
  * Tracking metadata for analytics (available in v1.0.23+)
222
534
  */
@@ -243,6 +555,14 @@ as?: React.ElementType;
243
555
  className?: string;
244
556
  }, DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
245
557
 
558
+ /**
559
+ * Play icon skin
560
+ */
561
+ export declare interface PlayIconSkin {
562
+ default?: string;
563
+ hover?: string;
564
+ }
565
+
246
566
  /**
247
567
  * API response structure for fetching playlist data.
248
568
  *
@@ -252,6 +572,47 @@ export declare interface PlaylistApiResponse {
252
572
  result: PlaylistItem[];
253
573
  }
254
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
+
255
616
  /**
256
617
  * Represents an item in a video playlist.
257
618
  *
@@ -272,35 +633,99 @@ export declare interface PlaylistItem {
272
633
  }
273
634
 
274
635
  /**
275
- * Video item for manual playlist
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
276
650
  */
277
- export declare interface PlaylistVideoItem {
278
- /** Unique video identifier */
651
+ export declare interface PlaylistVideoConfig {
279
652
  videoId: string;
280
- /** Video title */
281
653
  title: string;
282
- /** Video file URL (mp4, m3u8, etc.) */
283
654
  file: string;
284
- /** Alternative: HLS URL */
285
- hlsUrl?: string;
286
- /** Thumbnail image URL */
287
655
  thumbnailUrl?: string;
288
- /** Alternative: Thumbnail URL */
289
- thumbnail?: string;
290
- /** Video duration in seconds */
291
656
  duration?: number;
292
657
  }
293
658
 
659
+ /**
660
+ * Settings localization
661
+ */
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
+ }
672
+
673
+ /**
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
+
294
721
  /**
295
722
  * VP Player logic hook
296
723
  *
297
724
  * Supports two modes:
298
725
  * 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.
726
+ * 2. **Config override mode**: Fetch config, merge user overrides, and call setup()
302
727
  */
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) => {
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) => {
304
729
  playerRef: RefObject<HTMLDivElement | null>;
305
730
  playerInstanceRef: RefObject<VPPlayerInstance_2 | null>;
306
731
  isScriptLoaded: boolean;
@@ -345,6 +770,33 @@ export declare interface VideoApiResponse {
345
770
  };
346
771
  }
347
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
+
348
800
  /**
349
801
  * Result structure returned by the video data fetching logic.
350
802
  *
@@ -357,17 +809,34 @@ export declare interface VideoDataResult {
357
809
  error: string | null;
358
810
  }
359
811
 
812
+ /**
813
+ * Video flag/tag
814
+ */
815
+ export declare interface VideoFlag {
816
+ id: number;
817
+ name: string;
818
+ }
819
+
820
+ /**
821
+ * Volume skin configuration
822
+ */
823
+ export declare interface VolumeSkin {
824
+ dragger?: string;
825
+ progress?: string;
826
+ rail?: string;
827
+ notifier?: string;
828
+ }
829
+
360
830
  /**
361
831
  * Base URL for the VP Player host.
362
832
  */
363
833
  export declare const VP_PLAYER_BASE_URL = "https://host.vpplayer.tech";
364
834
 
365
835
  /**
366
- * VP Player Component (v2.0.0)
836
+ * VP Player Component
367
837
  *
368
838
  * 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.
839
+ * Configuration can be managed through the GTech admin panel or via the `config` prop.
371
840
  *
372
841
  * ## Basic Usage
373
842
  *
@@ -386,23 +855,42 @@ export declare const VP_PLAYER_BASE_URL = "https://host.vpplayer.tech";
386
855
  * />
387
856
  * ```
388
857
  *
389
- * ## Manual Playlist Mode (Vertical Player)
858
+ * ## Using the ref for imperative control
390
859
  *
391
- * For vertical player with custom videos array:
860
+ * ```tsx
861
+ * const playerRef = useRef<VPPlayerRef>(null);
862
+ *
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:
392
878
  *
393
879
  * ```tsx
394
880
  * <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,
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
+ * }
404
893
  * }}
405
- * onNext={() => console.log('Next video')}
406
894
  * />
407
895
  * ```
408
896
  *
@@ -422,42 +910,27 @@ export declare const VP_PLAYER_BASE_URL = "https://host.vpplayer.tech";
422
910
  *
423
911
  * @param props - VPPlayer configuration props
424
912
  */
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;
913
+ export declare const VPPlayer: ForwardRefExoticComponent<VPPlayerProps_2 & RefAttributes<VPPlayerRef_2>>;
426
914
 
427
915
  /**
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.
434
- *
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
916
+ * Full VP Player configuration
917
+ * This is the root configuration object passed to vpPlayer().setup()
440
918
  */
441
- export declare interface VPPlayerAdsConfig {
442
- skipAd?: {
443
- state: boolean;
444
- skipFrom: number;
445
- };
446
- vmap?: string;
447
- VPAIDmode?: string;
448
- enableProgrammability?: boolean;
449
- adBreaks?: Array<{
450
- adTagUrl: string[];
451
- breakType?: "preroll" | "midroll" | "postroll";
452
- breakTimingType?: "time" | "percentage" | "playlist";
453
- breakTimingValue?: number;
454
- }>;
919
+ export declare interface VPPlayerConfig {
920
+ projectId?: string;
921
+ biskoId?: string;
922
+ video?: VideoConfig;
923
+ config?: PlayerSettingsConfig;
455
924
  }
456
925
 
457
926
  /**
458
927
  * Interface representing an instance of the VP Player.
459
- * Based on VP Player API Reference: https://vp.gjirafa.tech/documentation/docs/web-player/api-reference
460
- * And VP Vertical Player API Reference: https://vp.gjirafa.tech/documentation/docs/vertical-player/api-reference
928
+ *
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
461
934
  *
462
935
  * @interface VPPlayerInstance
463
936
  */
@@ -476,8 +949,6 @@ export declare interface VPPlayerInstance {
476
949
  exitFullScreen?: () => void;
477
950
  enterFullscreen?: () => void;
478
951
  exitFullscreen?: () => void;
479
- enterPictureInPicture?: () => void;
480
- exitPictureInPicture?: () => void;
481
952
  togglePlay?: () => void;
482
953
  toggleMute?: () => void;
483
954
  isMuted?: () => boolean;
@@ -519,10 +990,10 @@ export declare interface VPPlayerInstance {
519
990
  }
520
991
 
521
992
  /**
522
- * Simplified props interface for VPPlayer v2.0.0
993
+ * Simplified props interface for VPPlayer
523
994
  *
524
- * The wrapper is now a thin bridge to the GTech JS player.
525
- * All configuration is managed through the GTech admin panel.
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.
526
997
  *
527
998
  * @interface VPPlayerProps
528
999
  */
@@ -543,34 +1014,42 @@ export declare interface VPPlayerProps {
543
1014
  */
544
1015
  scriptUrl?: string;
545
1016
  /**
546
- * GTech project ID (required for manual playlist mode)
1017
+ * GTech project ID
1018
+ * Convenience prop that gets merged into config.projectId
1019
+ * Can also be set directly in the config prop
547
1020
  */
548
1021
  projectId?: string;
549
1022
  /**
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.
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
553
1028
  *
554
- * IMPORTANT: This is required for vertical player when you want to
555
- * supply your own videos (not using GTech admin playlists).
1029
+ * If fetch fails, your config will be used directly.
556
1030
  *
557
1031
  * @example
558
1032
  * ```tsx
559
1033
  * <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,
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
+ * }
569
1046
  * }}
570
1047
  * />
571
1048
  * ```
1049
+ *
1050
+ * @see {@link https://vp.gjirafa.tech/documentation/docs/web-player/setup-the-player/full-configuration}
572
1051
  */
573
- playlist?: ManualPlaylistConfig;
1052
+ config?: DeepPartial<VPPlayerConfig>;
574
1053
  /**
575
1054
  * Custom container ID for the player div
576
1055
  * Auto-generated if not provided
@@ -669,4 +1148,52 @@ export declare interface VPPlayerProps {
669
1148
  onProgress20s?: (seconds: number) => void;
670
1149
  }
671
1150
 
1151
+ /**
1152
+ * Interface for the imperative handle exposed by VPPlayer via ref.
1153
+ * Use this to call player methods from parent components.
1154
+ *
1155
+ * @example
1156
+ * ```tsx
1157
+ * const playerRef = useRef<VPPlayerRef>(null);
1158
+ *
1159
+ * <VPPlayer ref={playerRef} scriptId="..." videoId="..." />
1160
+ *
1161
+ * // Later:
1162
+ * playerRef.current?.seek(60);
1163
+ * playerRef.current?.play();
1164
+ * ```
1165
+ */
1166
+ export declare interface VPPlayerRef {
1167
+ play: () => void;
1168
+ pause: () => void;
1169
+ seek: (position: number) => void;
1170
+ forward: () => void;
1171
+ rewind: () => void;
1172
+ replay: () => void;
1173
+ mute: () => void;
1174
+ unmute: () => void;
1175
+ togglePlay: () => void;
1176
+ toggleMute: () => void;
1177
+ enterFullScreen: () => void;
1178
+ exitFullScreen: () => void;
1179
+ getPosition: () => number | null;
1180
+ getDuration: () => number | null;
1181
+ getVolume: () => number | null;
1182
+ setVolume: (volume: number) => void;
1183
+ isMuted: () => boolean;
1184
+ isPlaying: () => boolean;
1185
+ isPaused: () => boolean;
1186
+ isFullscreen: () => boolean;
1187
+ }
1188
+
1189
+ /**
1190
+ * VP Vertical Player configuration
1191
+ * Similar to VPPlayerConfig but optimized for vertical video
1192
+ */
1193
+ export declare interface VPVerticalPlayerConfig {
1194
+ projectId?: string;
1195
+ video?: VideoConfig;
1196
+ config?: PlayerSettingsConfig;
1197
+ }
1198
+
672
1199
  export { }