← All demos

WHEP view

Watch a stream from any WHEP endpoint (Meshcast, Cloudflare Stream, other WHEP servers) with the standalone whep-client.js. No VDO.Ninja room is involved.

  1. Publish a stream first, for example with the WHIP publish demo. Its viewer link opens this page already filled in.
  2. Enter the WHEP URL. For Meshcast it is the WHIP URL with /whep/ instead of /whip/.
  3. Connect. It worked when the status turns green ("Live") and the received bitrate keeps rising.
  4. Unmute. Video starts muted so the browser allows autoplay.

Source

Player

Not connected

Log

Key WHEP client calls in this demo
const client = new WHEPClient('https://cae1.meshcast.io/whep/' + streamId, {
    video: true,
    audio: true
});
client.addEventListener('track', () => {
    video.srcObject = client.getStream();   // every track received so far
});
client.addEventListener('icestate', (e) => console.log('ICE', e.detail.state));

await client.view();   // POSTs a receive-only offer, waits up to 3 s for the first track
// <video autoplay playsinline muted> plus an Unmute button keeps autoplay working

await client.stop();   // DELETEs the session and closes the connection