@devix-technologies/react-gjirafa-vp-player 1.0.31-beta.6 → 1.0.31-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -18
- package/dist/index.d.ts +1 -6
- package/dist/react-gjirafa-vp-player.es.js +831 -816
- package/dist/react-gjirafa-vp-player.umd.js +8 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -157,24 +157,39 @@ The player fills its container (100% width/height). Control sizing with a wrappe
|
|
|
157
157
|
|
|
158
158
|
### Event Callbacks
|
|
159
159
|
|
|
160
|
-
| Prop | Description |
|
|
161
|
-
|
|
162
|
-
| `onReady` | Player initialized |
|
|
163
|
-
| `onPlay` | Playback started |
|
|
164
|
-
| `onPause` | Playback paused |
|
|
165
|
-
| `
|
|
166
|
-
| `
|
|
167
|
-
| `
|
|
168
|
-
| `
|
|
169
|
-
| `
|
|
170
|
-
| `
|
|
171
|
-
| `
|
|
172
|
-
| `
|
|
173
|
-
| `
|
|
174
|
-
| `
|
|
175
|
-
| `
|
|
176
|
-
| `
|
|
177
|
-
|
|
160
|
+
| Prop | Horizontal | Vertical | Description |
|
|
161
|
+
|------|:----------:|:--------:|-------------|
|
|
162
|
+
| `onReady` | ✓ | ✓ | Player initialized |
|
|
163
|
+
| `onPlay` | ✓ | ✓ | Playback started |
|
|
164
|
+
| `onPause` | ✓ | ✓ | Playback paused |
|
|
165
|
+
| `onComplete` | ✓ | ✗ | Video completed (horizontal only) |
|
|
166
|
+
| `onError` | ✓ | ✓ | Error occurred |
|
|
167
|
+
| `onVideoStarted` | ✓ | ✓ | Video metadata available (returns `CurrentVideoData`) |
|
|
168
|
+
| `onTimeUpdate` | ✓ | ✓ | Continuous time updates (returns seconds) |
|
|
169
|
+
| `onQuartile25` | ✓ | ✓ | 25% watched |
|
|
170
|
+
| `onQuartile50` | ✓ | ✓ | 50% watched |
|
|
171
|
+
| `onQuartile75` | ✓ | ✓ | 75% watched |
|
|
172
|
+
| `onNext` | ✓ | ✓ | Next video in playlist |
|
|
173
|
+
| `onPrevious` | ✗ | ✓ | Previous video (vertical only) |
|
|
174
|
+
| `onProgress10s` | ✓ | ✓ | Every ~10 seconds (returns seconds) |
|
|
175
|
+
| `onProgress20s` | ✓ | ✓ | 20 second milestone (returns seconds) |
|
|
176
|
+
| `onClose` | - | - | Reels overlay closed |
|
|
177
|
+
|
|
178
|
+
#### Event Implementation Notes
|
|
179
|
+
|
|
180
|
+
**Horizontal Player** uses standard VP Player SDK events:
|
|
181
|
+
- `ready`, `play`, `pause`, `complete`, `video-started`, `video-state`, `time`, `playlistItem`, `error`
|
|
182
|
+
- Quartiles: `analytics-25%-completed`, `analytics-50%-completed`, `analytics-75%-completed`
|
|
183
|
+
|
|
184
|
+
**Vertical Player** uses VP Vertical Player SDK events (different naming):
|
|
185
|
+
- `vp-ready`, `playing`, `pause`, `vp-video-started`, `vp-video-state`, `vp-time`, `vp-video-switch`, `error`
|
|
186
|
+
- Quartiles: `analytics-25%-completed`, `analytics-50%-completed`, `analytics-75%-completed`
|
|
187
|
+
- Direction detection: Uses `player._switchDirection` property (via `queueMicrotask`) to differentiate `onNext` vs `onPrevious`
|
|
188
|
+
|
|
189
|
+
**Key Differences:**
|
|
190
|
+
- `onComplete` - Only available on horizontal player (vertical auto-advances)
|
|
191
|
+
- `onPrevious` - Only available on vertical player (horizontal has no direction detection)
|
|
192
|
+
- `onNext` on horizontal fires for ANY playlist change (next button, auto-advance after complete)
|
|
178
193
|
|
|
179
194
|
## URL Helpers
|
|
180
195
|
|
package/dist/index.d.ts
CHANGED
|
@@ -254,7 +254,6 @@ export declare interface EventCallbackRefs {
|
|
|
254
254
|
onReady?: () => void;
|
|
255
255
|
onPlay?: () => void;
|
|
256
256
|
onPause?: () => void;
|
|
257
|
-
onResume?: () => void;
|
|
258
257
|
onComplete?: () => void;
|
|
259
258
|
onError?: (error: string) => void;
|
|
260
259
|
onVideoStarted?: (data: CurrentVideoData_2) => void;
|
|
@@ -725,7 +724,7 @@ export declare interface TimesliderSkin {
|
|
|
725
724
|
* 1. **Auto-init mode** (default): Load managed script that auto-initializes with GTech admin config
|
|
726
725
|
* 2. **Config override mode**: Fetch config, merge user overrides, and call setup()
|
|
727
726
|
*/
|
|
728
|
-
export declare const useVPPlayerLogic: ({ scriptId, videoId, scriptUrl, projectId, config, playerId, isVertical, isReels, onReady, onPlay, onPause,
|
|
727
|
+
export declare const useVPPlayerLogic: ({ scriptId, videoId, scriptUrl, projectId, config, playerId, isVertical, isReels, onReady, onPlay, onPause, onComplete, onError, onVideoStarted, onTimeUpdate, onQuartile25, onQuartile50, onQuartile75, onNext, onPrevious, onProgress10s, onProgress20s, }: VPPlayerProps_2) => {
|
|
729
728
|
playerRef: RefObject<HTMLDivElement | null>;
|
|
730
729
|
playerInstanceRef: RefObject<VPPlayerInstance_2 | null>;
|
|
731
730
|
isScriptLoaded: boolean;
|
|
@@ -1094,10 +1093,6 @@ export declare interface VPPlayerProps {
|
|
|
1094
1093
|
* Called when playback is paused
|
|
1095
1094
|
*/
|
|
1096
1095
|
onPause?: () => void;
|
|
1097
|
-
/**
|
|
1098
|
-
* Called when playback resumes after pause
|
|
1099
|
-
*/
|
|
1100
|
-
onResume?: () => void;
|
|
1101
1096
|
/**
|
|
1102
1097
|
* Called when video playback completes
|
|
1103
1098
|
*/
|