@devix-technologies/react-gjirafa-vp-player 1.0.31-beta.11 → 1.0.31-beta.13
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 +31 -7
- package/dist/react-gjirafa-vp-player.es.js +764 -762
- package/dist/react-gjirafa-vp-player.umd.js +6 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -160,8 +160,9 @@ The player fills its container (100% width/height). Control sizing with a wrappe
|
|
|
160
160
|
| Prop | Horizontal | Vertical | Description |
|
|
161
161
|
|------|:----------:|:--------:|-------------|
|
|
162
162
|
| `onReady` | ✓ | ✓ | Player initialized |
|
|
163
|
-
| `onPlay` | ✓ | ✓ | Playback started |
|
|
164
|
-
| `onPause` | ✓ | ✓ | Playback paused |
|
|
163
|
+
| `onPlay` | ✓ | ✓ | Playback started (initial play) |
|
|
164
|
+
| `onPause` | ✓ | ✓ | Playback paused (user-initiated) |
|
|
165
|
+
| `onResume` | ✗ | ✓ | Playback resumed after pause (vertical only) |
|
|
165
166
|
| `onComplete` | ✓ | ✗ | Video completed (horizontal only) |
|
|
166
167
|
| `onError` | ✓ | ✓ | Error occurred |
|
|
167
168
|
| `onVideoStarted` | ✓ | ✓ | Video metadata available (returns `CurrentVideoData`) |
|
|
@@ -177,19 +178,42 @@ The player fills its container (100% width/height). Control sizing with a wrappe
|
|
|
177
178
|
|
|
178
179
|
#### Event Implementation Notes
|
|
179
180
|
|
|
180
|
-
**Horizontal Player** uses standard VP Player SDK events:
|
|
181
|
+
**Horizontal Player** uses standard VP Player SDK events via `.on()` listener:
|
|
181
182
|
- `ready`, `play`, `pause`, `complete`, `video-started`, `video-state`, `time`, `playlistItem`, `error`
|
|
182
183
|
- Quartiles: `analytics-25%-completed`, `analytics-50%-completed`, `analytics-75%-completed`
|
|
183
184
|
|
|
184
|
-
**Vertical Player** uses
|
|
185
|
-
|
|
185
|
+
**Vertical Player** uses a combination of `.on()` listener and the global `vp-event` handler:
|
|
186
|
+
|
|
187
|
+
Standard events via `.on()`:
|
|
188
|
+
- `vp-first-frame`, `vp-video-started`, `vp-video-state`, `vp-time`, `vp-video-switch`, `error`
|
|
186
189
|
- Quartiles: `analytics-25%-completed`, `analytics-50%-completed`, `analytics-75%-completed`
|
|
187
|
-
|
|
190
|
+
|
|
191
|
+
**Special handling via `vp-event` handler** (not exposed via standard `.on()`):
|
|
192
|
+
|
|
193
|
+
The following events are intercepted from the global `vp-event` emission because the VP Vertical Player SDK doesn't expose them via the standard `.on()` listener:
|
|
194
|
+
|
|
195
|
+
| Event | SDK Event | Special Logic |
|
|
196
|
+
|-------|-----------|---------------|
|
|
197
|
+
| `onPlay` | `vp-state-playing` | Fires on initial play (when not resuming from pause) |
|
|
198
|
+
| `onPause` | `vp-state-paused` | Only fires on **user-initiated** pause (not on video loop/end) |
|
|
199
|
+
| `onResume` | `vp-state-playing` | Fires when resuming after **user-initiated** pause |
|
|
200
|
+
|
|
201
|
+
**User Interaction Tracking:**
|
|
202
|
+
|
|
203
|
+
To distinguish between user actions and automatic playback events (like video loops), we track the `vp-user-interaction` event:
|
|
204
|
+
- When `vp-user-interaction` fires before `vp-state-paused` → user clicked pause → `onPause` fires
|
|
205
|
+
- When `vp-user-interaction` fires before `vp-state-playing` (after pause) → user clicked play → `onResume` fires
|
|
206
|
+
- When `vp-state-paused` fires without prior user interaction → video ended/looped → no `onPause` (silent)
|
|
207
|
+
- When `vp-state-playing` fires without prior pause → initial play or loop restart → `onPlay` fires
|
|
208
|
+
|
|
209
|
+
This ensures analytics events like `player_pause` and `player_resume` only fire for actual user actions, not automatic video looping.
|
|
188
210
|
|
|
189
211
|
**Key Differences:**
|
|
190
|
-
- `onComplete` - Only available on horizontal player (vertical auto-advances)
|
|
212
|
+
- `onComplete` - Only available on horizontal player (vertical auto-advances to next video)
|
|
213
|
+
- `onResume` - Only available on vertical player (horizontal has no pause/resume distinction)
|
|
191
214
|
- `onPrevious` - Only available on vertical player (horizontal has no direction detection)
|
|
192
215
|
- `onNext` on horizontal fires for ANY playlist change (next button, auto-advance after complete)
|
|
216
|
+
- Direction detection on vertical uses `player._switchDirection` property (via `queueMicrotask`) to differentiate `onNext` vs `onPrevious`
|
|
193
217
|
|
|
194
218
|
## URL Helpers
|
|
195
219
|
|