Skip to content
NorthstarPlatformPricingLogin

Stream screencast video and cursor events

client.computers.retrieveScreencast(stringid, RequestOptionsoptions?): void
GET/computers/{id}/screencast

Server-Sent Events stream carrying the video + cursor traffic for a live session. The event shapes depend on session kind:

  • Browser sessions emit default (unnamed) SSE events whose data is a JSON object with a base64-encoded JPEG frame in image_data and a metadata object containing timestamp and viewport dimensions.
  • Desktop sessions emit three named event types: event: h264 carries a JSON object whose nalu_data field is a base64-encoded raw H.264 NAL-unit blob suitable for feeding into a WebCodecs VideoDecoder; event: cursor_update carries a cursor-sprite bitmap and hotspot, emitted only when the cursor shape changes; event: cursor_position carries x / y coordinates, emitted once per video frame while the cursor is moving.

A : heartbeat SSE comment is sent every 30 seconds to keep intermediaries from closing the connection. Action responses and command output are delivered on /computers/{id}/events instead and are deliberately excluded from this stream.

ParametersExpand Collapse
id: string

Stream screencast video and cursor events

import Lightcone from '@tzafon/lightcone';

const client = new Lightcone({
  apiKey: process.env['TZAFON_API_KEY'], // This is the default and can be omitted
});

await client.computers.retrieveScreencast('id');
Returns Examples