You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+38-16Lines changed: 38 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,5 @@
1
1
# @interactive-video-labs/react
2
+
2
3
<palign="center">
3
4
<imgsrc="https://raw.githubusercontent.com/interactive-video-labs/docs/main/logo.svg"width="200px"alt="Interactive Video Labs Logo" />
4
5
</p>
@@ -11,8 +12,6 @@
11
12
</a>
12
13
</p>
13
14
14
-
15
-
16
15
Welcome to `@interactive-video-labs/react` — a lightweight React wrapper around the `@interactive-video-labs/core` engine for cue-driven interactive video experiences.
17
16
18
17
This wrapper makes it easy to embed interactive video players in React apps using familiar props and event handlers, while keeping close to the core API.
@@ -25,11 +24,11 @@ This wrapper makes it easy to embed interactive video players in React apps usin
25
24
26
25
## Features
27
26
28
-
***Easy Integration**: Seamlessly embed interactive videos into your React components.
29
-
***Cue Point Management**: Load and manage cue points for dynamic video interactions.
30
-
***Analytics Events**: Receive detailed analytics events from the video player to track user engagement.
31
-
***Localization**: Support for player localization through translations.
32
-
***Direct Core API Access**: Provides a React-friendly interface while maintaining close alignment with the core IVLabsPlayer API.
27
+
-**Easy Integration**: Seamlessly embed interactive videos into your React components.
28
+
-**Cue Point Management**: Load and manage cue points for dynamic video interactions.
29
+
-**Analytics Events**: Receive detailed analytics events from the video player to track user engagement.
30
+
-**Localization**: Support for player localization through translations.
31
+
-**Direct Core API Access**: Provides a React-friendly interface while maintaining close alignment with the core IVLabsPlayer API.
33
32
34
33
## Installation
35
34
@@ -62,8 +61,31 @@ const MyVideoPlayer = () => {
62
61
// Handle analytics events, e.g., send to a tracking service
63
62
}}
64
63
cues={[
65
-
{ time: 10, id: 'intro-cue', type: 'pause' },
66
-
{ time: 25, id: 'question-cue', type: 'custom', data: { question: 'What is your favorite color?' } },
64
+
{
65
+
id: 'segmentChange',
66
+
time: 10,
67
+
label: 'Segment Change',
68
+
payload: {
69
+
interaction: {
70
+
type: 'choice-video-segment-change',
71
+
title: 'Choose your path',
72
+
description: 'Select a video segment to jump to.',
The `InteractiveVideo` component accepts the following props:
85
107
86
-
*`videoUrl` (string, **required**): The URL of the video to be played.
87
-
*`onAnalyticsEvent` (function, optional): A callback function that is triggered when an analytics event occurs. It receives the `event` name and an optional `payload`.
*`payload`: An object containing event-specific data.
90
-
*`cues` (CuePoint[], optional): An array of cue points to load into the player. Each `CuePoint` object should conform to the `@interactive-video-labs/core``CuePoint` interface.
91
-
*`translations` (Translations, optional): An object containing translations for player localization. This should conform to the `@interactive-video-labs/core``Translations` interface.
92
-
*`...restOptions` (PlayerConfig, optional): Any other valid `PlayerConfig` options from `@interactive-video-labs/core` (excluding `videoUrl`, `cues`, and `translations`). This allows for direct pass-through of core player configurations like `autoplay`, `loop`, `controls`, `locale`, etc.
108
+
-`videoUrl` (string, **required**): The URL of the video to be played.
109
+
-`onAnalyticsEvent` (function, optional): A callback function that is triggered when an analytics event occurs. It receives the `event` name and an optional `payload`.
-`payload`: An object containing event-specific data.
112
+
-`cues` (CuePoint[], optional): An array of cue points to load into the player. Each `CuePoint` object should conform to the `@interactive-video-labs/core``CuePoint` interface.
113
+
-`translations` (Translations, optional): An object containing translations for player localization. This should conform to the `@interactive-video-labs/core``Translations` interface.
114
+
-`...restOptions` (PlayerConfig, optional): Any other valid `PlayerConfig` options from `@interactive-video-labs/core` (excluding `videoUrl`, `cues`, and `translations`). This allows for direct pass-through of core player configurations like `autoplay`, `loop`, `controls`, `locale`, etc.
0 commit comments