ScreenStream interface

extends VideoStream

Screen-share stream. Identical shape to VideoStream for v1 โ€” distinct type reserved for future screen-specific extensions (e.g. cursor capture, source-window metadata). Extended by LocalScreenStream and RemoteScreenStream.

Blueprint

Inherits everything from VideoStream. No own additions in v1.

interface ScreenStream extends VideoStream { // All members inherited from VideoStream โ€” no additions in v1. }

Inherited from VideoStream

All properties and methods from VideoStream apply: id, codec, dimensions, frameRate, contentHint, isPlaying / isPaused / isEnded, attach / detach, createElement, getStats, getMediaStreamTrack.

Operational events live on the subtypes โ€” RemoteScreenStream exposes state-changed (routing + decoder: paused / frozen / stuck / ended) and quality-changed (simulcast layer switches); LocalScreenStream exposes ended (browser stop-sharing).

Notes

Screen audio (system audio captured along with the screen) is bundled into the same Screen MediaKind on the wire โ€” one subscribe call covers both. The audio is exposed through the screen stream as a nested .audio property: LocalScreenStream.audio is a LocalScreenAudioStream; RemoteScreenStream.audio is a RemoteScreenAudioStream.

Example โ€” render a remote screen-share with audio
// Remote side โ€” single subscribe covers both screen video and screen audio
await p.subscribe([MediaKind.Screen]);

p.screen.attach(document.querySelector('#screen-pane'));
// Audio plays automatically through the SDK-managed audio element

// Audio-specific control via nested .audio
p.screen.audio?.setVolume(0.5);
const level = p.screen.audio?.audioLevel;

See also: LocalScreenStream RemoteScreenStream VideoStream

Related open questions: Q13 โ€” Stream object abstraction across platforms