Session Player
The Session Player widget is a full-width button that opens a dialog with a media player for the recording of a session. In Frames mode it plays a sequence of WebP images named by their capture time; in Video mode it plays a video file. The player has a play/pause button, a timeline and a speed menu.
Palette: category Utils, label session player. 1 input, 1 output.
Configuration
| Property | Description | Default |
|---|---|---|
| Name | Node name shown in the editor. | '' |
| Group | Dashboard group where the button is shown. | (required) |
| Size | Width and height of the widget (0 = automatic). | 0 / 0 |
| Player Mode | Frames plays a sequence of images, Video plays a video file. Messages cannot change it. | frames |
| Preload Buffer | Frames mode: number of frames fetched ahead of the one on screen. Empty or 0 uses 15. | 15 |
| Text Color | Colour of the play and speed buttons, as #RRGGBB or rgb(r, g, b). The colour picker next to the field fills it. | #FFFFFF |
| Button Label | Text of the button that opens the player. Required. | Session Video |
| Dialog Title | Title of the dialog, shown in capitals. Required. | Recall Video |
The player
The player area is up to 800 pixels wide and 650 pixels high, on a black background, with a dark blue control bar:
- Play/pause button. Clicking the image, or pressing Space while the player has focus, does the same.
- Timeline. Dragging it moves to that point. Its tooltip shows the date and time of the point in Frames mode (browser locale), and minutes and seconds in Video mode.
- Speed button with a cog icon: 0.5x, 0.75x, 1x, 1.25x, 1.5x, 2x and 3x.
In Frames mode, playback follows the capture times: the timeline runs from the first to the last timestamp, and at each moment the frame closest to the current time is shown, so a gap in the capture is a pause in the playback. Playback stops at the end; pressing play again starts over. After showing a frame, the player fetches the next frames given by Preload Buffer.
Without data (Frames mode without frames or base URL, Video mode without a video), the dialog shows No data available to play. Select a session to load data.
Input
| Property | Type | Description |
|---|---|---|
payload.frames | array | Frames mode. Capture times of the frames in milliseconds since 1970, as numbers or numeric strings, in ascending order. Replaces the previous list; an empty array clears it. |
payload.frameBaseUrl | string | Frames mode. URL of the folder of the frames, without a trailing slash. The frame with time t is fetched from <frameBaseUrl>/<t>.webp. |
payload.videoSrc | string | Video mode. URL of the video, played by the browser's video element. |
A property that is missing, or an empty string, keeps its previous value; other properties of the payload are ignored. Any change of the frames, the base URL or the video stops playback and returns to the start. Messages are taken whether the dialog is open or closed. Unlike Session Images, the node does not add itself to the base's Accept Client Data list, so by default every browser showing the widget receives each message, even one that carries msg._client.
The node keeps the last message it received and the widget reads it when it loads, so a browser that opens the page later gets it. Only the last message is kept: send frames and frameBaseUrl together.
Frames are fetched by the browser. The URL must be reachable from the browser, and a URL on another origin must allow the request with CORS headers.
Output
This node does not send messages. The output port is never used.
Status and errors
No group configured: logged when the node has no group. The widget is not shown.- In Frames mode, a frame that cannot be fetched (network or CORS error) is reported in the browser console as
Error loading frame <timestamp>:and the previous frame stays on screen.
Usage example
Player Mode Frames. A function node receives in msg.files the file names of the frame folder of a session, and in msg.sessionId the session. The folder is served by an HTTP server the browser can reach, here under /recordings/:
const frames = msg.files
.filter((file) => file.endsWith(".webp"))
.map((file) => Number(file.slice(0, -5)))
.filter(Number.isFinite)
.sort((a, b) => a - b);
msg.payload = {
frameBaseUrl: "/recordings/" + msg.sessionId,
frames
};
return msg;With Player Mode Video, the payload carries the video instead:
msg.payload = { videoSrc: "/recordings/" + msg.sessionId + "/session.mp4" };
return msg;