Tip: avoid reserved SDK types (subscribe | unsubscribe | channelMessage) for custom protocols.
const vdo = new VDONinjaSDK(options)
wss://wss.vdo.ninja)connect(), disconnect()joinRoom({ room, password }), leaveRoom()autoConnect(roomOrOptions, filter?) → { stop, streamID }publish(stream, { streamID, room?, label?, password? })announce({ streamID?, room?, label?, password? })stopPublishing()view(streamID, { audio=true, video=true, label? })stopViewing(streamID)quickPublish({ stream, room?, streamID?, label?, password? })quickView({ streamID, room?, audio?, video?, label?, password?, dataOnly? })quickSubscribe({ streamID, room?, ... }) (defaults to data-only)sendData(data, target?) — flexible targeting with DC and fallbacksendPing(uuid?)request(type, data, targetUUID, timeout?), respond(id, data, targetUUID)onRequest(type, handler)subscribe(channels), unsubscribe(channels), getSubscriptions()publishToChannel(channel, data, target='all')getPeerSubscriptions(uuid)channelMessage, peerSubscribed, peerUnsubscribedgetStats(uuid?)play|watch|startViewing → view, stream|broadcast|startPublishing|share → publish, quickStream|quickBroadcast|quickShare → quickPublish, stop|stopPlaying|stopWatching → stopViewing, stopStreaming|stopBroadcasting|stopSharing|unpublish → stopPublishing, join|enterRoom|enter → joinRoom, leave|exitRoom → leaveRoomconnected, disconnected, reconnecting, reconnected, reconnectFailedroomJoined, roomLeft, listing, peerListingpeerConnected, peerDisconnected, dataChannelOpen, dataChannelClose, peerInfo, peerLatencydataReceived (dataRecieved alias), datatrack, trackAdded, trackRemoved, trackReplacedpublishing, publishingStopped, viewingStopped, iceRestart, connectionFailed, alert, errorStandalone clients for standard WebRTC-HTTP streaming protocols. Works independently of the VDO.Ninja P2P system.
Publish media streams to WHIP-compatible endpoints (Twitch, Meshcast, Cloudflare, etc.)
const client = new WHIPClient(endpoint, options)
Methods:
publish(stream) — Publish a MediaStreamreplaceTrack(oldTrack, newTrack) — Replace a track mid-sessionstop() — Stop publishing and cleanupgetStats() — Get RTCStatsReportrestartIce() — Restart ICE connectionEvents: connecting, connected, icestate, connectionstate, error, disconnected, stopped
Consume media streams from WHEP-compatible endpoints.
const client = new WHEPClient(endpoint, options)
Methods:
view() — Start viewing, returns MediaStreamgetStream() — Get the received MediaStreammuteAudio(muted), muteVideo(muted) — Mute locallystop() — Stop viewing and cleanupgetStats() — Get RTCStatsReportEvents: connecting, connected, track, icestate, connectionstate, error, disconnected, stopped
https://cae1.meshcast.io/whip/{id} / https://cae1.meshcast.io/whep/{id}https://g.webrtc.live-video.net:4443/v2/offer (WHIP only)