RemoteScreenAudioStream interface

extends AudioStream  REMOTE

A remote participant's screen-share audio stream. Available via p.screen.audio when the publisher included audio in their screen share. SDK auto-plays it like any remote audio.

Blueprint

Members added on top of AudioStream. Routing control (pause / resume) is bundle-level on the parent RemoteScreenStream โ€” not on this audio stream.

interface RemoteScreenAudioStream extends AudioStream { // State + level โ€” streamState mirrors the parent screen stream readonly streamState: "active" | "paused" | "ended"; readonly audioLevel: number; // Per-participant playback volume (independent of mic volume) setVolume(level: number): void; // No pause/resume โ€” bundle-level control is on RemoteScreenStream // No own events โ€” state mirrors parent's state-changed }
Lifecycle and routing control are on the screen video. When you call p.screen.pause() the SDK pauses the bundle (both video and audio bytes); the audio's streamState mirrors the screen's. There's no separate pause() on this audio stream.

Properties (added)

Plus inherited from AudioStream: id, codec, isPlaying, isMuted, isEnded.

streamState

Routing state of this screen-audio stream. Mirrors the parent screen's state โ€” when p.screen.pause() is called, both transition to "paused". No frozen / stuck values (audio doesn't have decoder-freeze observation).

readonly streamState: "active" | "paused" | "ended"

audioLevel

Current screen-audio level, normalized 0..1. Useful for visualizing system-audio activity (game audio, music) on a presentation.

readonly audioLevel: number

Methods (added)

Plus inherited from AudioStream: attach / detach (escape hatch โ€” SDK auto-plays by default), getStats, getMediaStreamTrack.

setVolume

Adjust the playback volume of this participant's screen audio in the SDK-managed audio element. Independent from their mic volume โ€” useful when their game audio is too loud relative to their voice.

setVolume(level: number): void // 0..1
Example โ€” duck screen audio when mic gets loud
setInterval(() => {
  if (p.audio?.audioLevel > 0.6) {
    p.screen?.audio?.setVolume(0.2);   // duck game audio while talking
  } else {
    p.screen?.audio?.setVolume(0.8);
  }
}, 200);

Events

No own events. State transitions (paused / ended / etc.) fire on the parent p.screen via state-changed; this audio stream's streamState just mirrors the parent.

SDK auto-plays remote screen audio. No need to attach() โ€” the SDK creates an internal audio element and plays it automatically (subject to browser autoplay policies). Use attach only for custom output device routing or Web Audio integration.

See also: AudioStream RemoteScreenStream LocalScreenAudioStream RemoteParticipant