← 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.
- Start publishing to capture your camera. The room and stream ID are in the share link.
- Start viewing here, or open the share link in a second tab or device and press Start viewing there.
- Press Mute video to flip
track.enabled. The viewer receives avideoMutedpayload right away. - Stop track triggers the
endedpath. Acquire new track captures a fresh camera and replaces it on the fly.
Session
Publisher
Not publishingPublishes your camera with automatic mute signalling. Toggle track.enabled or stop the track entirely.
No track yet
Viewer
Not viewingViews the same stream, blanks the video when videoMuted: true arrives, and restores it when unmuted.
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 });