Interactive video events
When a WeVideo interactive video is embedded on your site in an iframe, the player posts events to the embedding page using window.postMessage. You can use these to track viewer engagement — for example sending responses to your analytics or CRM. A typical embed URL would be an anonymous assignment link, for example https://www.wevideo.com/api/5/bulbs/assignment/123/go
Listening for events
Each message is a JSON string with a type and a data object:
window.addEventListener("message", (event) => {
if (event.origin !== "https://www.wevideo.com") return; // ignore other senders
let message;
try {
message = JSON.parse(event.data);
} catch {
return; // not a WeVideo event
}
switch (message.type) {
case "interactive_video_started":
console.log("Viewer started the video", message.data);
break;
case "interactive_video_interaction_completed":
console.log("Viewer answered an interaction", message.data);
break;
case "interactive_video_completed":
console.log("Viewer completed the video", message.data);
break;
case "interactive_video_exited":
console.log("User left the designer or player", message.data);
break;
}
});
Events
interactive_video_started
Sent once per page load, when playback first starts.
| Field | Type | Description |
|---|---|---|
interactiveVideoId | number | ID of the interactive video |
title | string | Title of the interactive video |
userId | number | Viewer's WeVideo user ID |
firstName | string | Viewer's first name |
lastName | string | Viewer's last name |
attemptId | number | null | ID of the viewing attempt |
interactive_video_interaction_completed
Sent every time the viewer submits a response to an interaction (question, poll, etc.).
| Field | Type | Description |
|---|---|---|
interactiveVideoId | number | ID of the interactive video |
userId | number | Viewer's WeVideo user ID |
attemptId | number | null | ID of the viewing attempt |
interactionId | number | ID of the interaction that was answered |
interactionType | string | Interaction type, e.g. multiple_choice, check_all_apply, free_response, poll_q, short_answer |
correct | boolean | null | Whether the response was correct; null for ungraded types like polls |
response.text | string | null | The submitted response text, when the interaction has a text response |
response.interactionOptionIds | string[] | null | IDs of the selected answer options, when the interaction has options |
interactive_video_completed
Sent when the viewer completes the interactive video. Sent at most once per attempt — a retake (new attempt) can produce another one.
| Field | Type | Description |
|---|---|---|
interactiveVideoId | number | ID of the interactive video |
title | string | Title of the interactive video |
userId | number | Viewer's WeVideo user ID |
firstName | string | Viewer's first name |
lastName | string | Viewer's last name |
attemptId | number | null | ID of the viewing attempt |
assignmentId | number | null | Assignment ID, when viewed as part of an assignment |
status | string | Always "completed" |
pointsEarned | number | null | Points the viewer earned across graded interactions |
pointsAvailable | number | null | Total points available in the video |
interactive_video_incomplete
Sent when the viewer reaches the end of the video without meeting the completion criteria (for example a required score threshold). Same payload as interactive_video_completed, with status set to "incomplete".
interactive_video_exited
Sent when the user leaves the interactive video designer or player through one of its exit buttons. Sent on every exit click.
| Field | Type | Description |
|---|---|---|
interactiveVideoId | number | ID of the interactive video |
title | string | Title of the interactive video |
userId | number | null | User's WeVideo user ID |
app | string | "designer" or "player" |
location | string | Which exit the user took (see below) |
attemptId | number | null | Player only: ID of the viewing attempt; null in the designer |
location | App | Exit |
|---|---|---|
save_and_exit | designer | The Save and exit button |
finish_and_exit | player | The Finish and exit button |
sidebar_back | both | The back arrow in the side menu |
error_dialog | player | The exit button shown when the video fails to load |
Without contained embed mode (below), the designer or player navigates as usual right after sending this event.
Contained embed mode
If you sign users in through the login token flow and show the designer or player in an iframe on your site, you can keep the user inside the designer and player and handle exits yourself. Pass embedMode in the properties of the login token request:
POST /api/5/login-token/{userId}
{
"launchPath": "/interactive/player_v2?type=share&bulb_id=123",
"properties": { "embedMode": "contained" }
}
When the page is in an iframe and embedMode is contained:
- Exits send
interactive_video_exitedand stay on the current page instead of navigating. Your page is expected to close the iframe. - Links and buttons that lead to other WeVideo pages, such as the dashboard, are hidden.
The setting lasts for the session started by the login token. Opened outside an iframe, the designer and player behave as usual.
Playlist events
When a WeVideo playlist is embedded on your site in an iframe, the playlist posts these events to the embedding page, in the same format as the interactive video events. The interactive videos inside the playlist post their own interactive_video_* events to the playlist, not to your page, so listen for the playlist events instead.
playlist_completed
Sent when the viewer completes the last remaining item in the playlist. Sent at most once per playlist attempt, and not sent when the viewer reopens a playlist they have already completed.
| Field | Type | Description |
|---|---|---|
playlistId | number | ID of the playlist |
title | string | Title of the playlist |
userId | number | Viewer's WeVideo user ID |
firstName | string | Viewer's first name |
lastName | string | Viewer's last name |
attemptId | number | null | ID of the playlist attempt |
assignmentId | number | null | Assignment ID, when viewed as part of an assignment |
playlist_exited
Sent when the viewer clicks Save & Exit, after their progress has been saved. Sent every time, so clicking it again sends it again.
| Field | Type | Description |
|---|---|---|
playlistId | number | ID of the playlist |
title | string | Title of the playlist |
userId | number | Viewer's WeVideo user ID |
attemptId | number | null | ID of the playlist attempt |