@devix-technologies/react-gjirafa-vp-player 1.0.31-beta.17 → 1.0.31-beta.19

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
@@ -6,6 +6,7 @@ import { RefAttributes } from 'react';
6
6
  import { RefObject } from 'react';
7
7
  import { StyledComponent } from '@emotion/styled';
8
8
  import { Theme } from '@emotion/react';
9
+ import { VideoLockingConfig as VideoLockingConfig_2 } from '../../../../../../../src/interfaces';
9
10
  import { VPPlayerInstance as VPPlayerInstance_2 } from '../../../../../../../src/interfaces';
10
11
  import { VPPlayerProps as VPPlayerProps_2 } from '../../../../../../../src/interfaces';
11
12
  import { VPPlayerRef as VPPlayerRef_2 } from '../../../../../../../src/interfaces';
@@ -263,10 +264,11 @@ export declare interface EventCallbackRefs {
263
264
  onQuartile25?: () => void;
264
265
  onQuartile50?: () => void;
265
266
  onQuartile75?: () => void;
266
- onNext?: () => void;
267
- onPrevious?: () => void;
267
+ onNext?: (currentTime: number) => void;
268
+ onPrevious?: (currentTime: number) => void;
268
269
  onProgress10s?: (seconds: number) => void;
269
270
  onProgress20s?: (seconds: number) => void;
271
+ onPlaylistItem?: (data: CurrentVideoData_2) => void;
270
272
  }
271
273
 
272
274
  /**
@@ -726,13 +728,15 @@ export declare interface TimesliderSkin {
726
728
  * 1. **Auto-init mode** (default): Load managed script that auto-initializes with GTech admin config
727
729
  * 2. **Config override mode**: Fetch config, merge user overrides, and call setup()
728
730
  */
729
- 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) => {
731
+ 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, onPlaylistItem, }: VPPlayerProps_2) => {
730
732
  playerRef: RefObject<HTMLDivElement | null>;
731
733
  playerInstanceRef: RefObject<VPPlayerInstance_2 | null>;
732
734
  isScriptLoaded: boolean;
733
735
  isLoading: boolean;
734
736
  error: string | null;
735
737
  generatedPlayerId: string;
738
+ isInPlaylistTransitionRef: RefObject<boolean>;
739
+ pendingVideoLockingRef: RefObject<VideoLockingConfig_2 | null>;
736
740
  };
737
741
 
738
742
  /**
@@ -818,6 +822,12 @@ export declare interface VideoFlag {
818
822
  name: string;
819
823
  }
820
824
 
825
+ export declare interface VideoLockingConfig {
826
+ isEnabled: boolean;
827
+ type: "seconds" | "percentage";
828
+ value: number;
829
+ }
830
+
821
831
  /**
822
832
  * Volume skin configuration
823
833
  */
@@ -936,7 +946,7 @@ export declare interface VPPlayerConfig {
936
946
  * @interface VPPlayerInstance
937
947
  */
938
948
  export declare interface VPPlayerInstance {
939
- setup: (config: unknown) => void;
949
+ setup: (config: unknown) => Promise<void> | void;
940
950
  destroy?: () => void;
941
951
  play?: () => void;
942
952
  pause?: () => void;
@@ -974,6 +984,7 @@ export declare interface VPPlayerInstance {
974
984
  setCurrentQuality?: (index: number) => void;
975
985
  setLevelToAuto?: () => void;
976
986
  setCuePoint?: (cue: number, callback: () => void) => void;
987
+ setVideoLocking?: (config: VideoLockingConfig) => void;
977
988
  on?: (event: string, callback: (data?: unknown) => void) => void;
978
989
  off?: (event: string, callback?: (data?: unknown) => void) => void;
979
990
  videoIndex?: number;
@@ -1132,13 +1143,15 @@ export declare interface VPPlayerProps {
1132
1143
  */
1133
1144
  onQuartile75?: () => void;
1134
1145
  /**
1135
- * Called when transitioning to the next video in playlist
1146
+ * Called when user clicks the next button (not on auto-advance)
1147
+ * @param currentTime - Current playback position when clicked
1136
1148
  */
1137
- onNext?: () => void;
1149
+ onNext?: (currentTime: number) => void;
1138
1150
  /**
1139
- * Called when transitioning to the previous video in playlist
1151
+ * Called when user clicks the previous button (vertical player only)
1152
+ * @param currentTime - Current playback position when clicked
1140
1153
  */
1141
- onPrevious?: () => void;
1154
+ onPrevious?: (currentTime: number) => void;
1142
1155
  /**
1143
1156
  * Called every 10 seconds during playback
1144
1157
  * @param seconds - Current playback position in seconds
@@ -1149,6 +1162,12 @@ export declare interface VPPlayerProps {
1149
1162
  * @param seconds - Current playback position (should be ~20)
1150
1163
  */
1151
1164
  onProgress20s?: (seconds: number) => void;
1165
+ /**
1166
+ * Called when the active playlist item changes (horizontal player only)
1167
+ * Fires reliably for all playlist transitions, including auto-advance
1168
+ * @param data - Video metadata for the new playlist item
1169
+ */
1170
+ onPlaylistItem?: (data: CurrentVideoData_2) => void;
1152
1171
  }
1153
1172
 
1154
1173
  /**
@@ -1187,6 +1206,11 @@ export declare interface VPPlayerRef {
1187
1206
  isPlaying: () => boolean;
1188
1207
  isPaused: () => boolean;
1189
1208
  isFullscreen: () => boolean;
1209
+ /**
1210
+ * Set video locking configuration dynamically.
1211
+ * This is the correct way to enable/disable video locking after the player has started.
1212
+ */
1213
+ setVideoLocking: (config: VideoLockingConfig) => void;
1190
1214
  }
1191
1215
 
1192
1216
  /**