← All demos

Video mute signals

Publish your camera, then mute or stop the track. The SDK watches the outgoing video track and sends { videoMuted } to every viewer over the data channel; the viewer blanks its video when the signal arrives.

  1. Start publishing to capture your camera. The room and stream ID are in the share link.
  2. Start viewing here, or open the share link in a second tab or device and press Start viewing there.
  3. Press Mute video to flip track.enabled. The viewer receives a videoMuted payload right away.
  4. Stop track triggers the ended path. Acquire new track captures a fresh camera and replaces it on the fly.

Session

Publisher

Not publishing

Publishes your camera with automatic mute signalling. Toggle track.enabled or stop the track entirely.

Waiting for local track…
No track yet

Viewer

Not viewing

Views the same stream, blanks the video when videoMuted: true arrives, and restores it when unmuted.

Waiting for video…
Not viewing
Key SDK calls in this demo
// Publisher: the SDK watches the outgoing video track for you
const pub = new VDONinjaSDK({ room });
pub.addEventListener('publisherVideoMuteState', (e) => console.log(e.detail.muted, e.detail.reason));
await pub.connect();
await pub.publish(cameraStream, { room, streamID, label });
videoTrack.enabled = false;   // viewers get { videoMuted: true }

// Viewer: react to the signal
const viewer = new VDONinjaSDK({ room });
viewer.addEventListener('remoteVideoMuteState', (e) => {
    videoEl.classList.toggle('muted-display', e.detail.muted);
});
await viewer.connect();
await viewer.quickView({ room, streamID, video: true, audio: false });