What if the browser says “access to the camera/microphone is not allowed”?
Cause: the browser permission was denied, or the page isn’t in a secure context (HTTPS / localhost). Steps to fix:- Make sure the page is accessed over HTTPS or localhost (plain HTTP domains can’t access media devices)
- Click the camera/microphone icon on the right side of the browser address bar and change the permission to “Allow”
- If you previously chose “Always block”, reset the permission manually in the browser’s site settings:
- Chrome: ”🔒” on the left of the address bar → “Site settings” → “Camera/Microphone” → “Allow”
- Refresh the page and try again
secure and mediaDevices fields of srtc.getEnvInfo():
What if I can receive but not publish during local development?
Cause: most likely the page is running over plain HTTP, and the browser restricts WebRTC publishing. Solution: access your local development environment viahttp://localhost or http://127.0.0.1, not http://[local LAN IP] (publishing isn’t supported over that protocol).
For protocol and publishing support, see Integration - URL protocol restrictions.
How do I handle video/audio autoplay being blocked by the browser?
The browser’s autoplay policy forbids playing media without a user gesture; the symptom is no audio or no video after callingstartPlay().
The SDK notifies you through the TRACK_AUTOPLAY_FAIL event:
Best practice: calljoinandstartPlayafter the user actively clicks a “Join” or “Start call” button; this user gesture context usually gets around the autoplay restriction.
Is screen sharing unavailable on Safari?
Safari 15.4 and above supportgetDisplayMedia (screen sharing), with these limitations:
- Capturing system audio isn’t supported (
getAudioTrack()returnsundefined) - Screen sharing isn’t supported on iOS Safari (a system limitation)
- Some older Safari versions (< 15.4) don’t support screen sharing at all
srtc.getEnvInfo().screenshare:
What if joining the channel fails with TokenExpired?
The token is issued by the server and has a short validity period (usually from a few minutes to a few hours, decided by the issuer). Solution:- Get a fresh token from the server right before calling
srtc.join(); don’t cache old tokens - Check that the client and server system clocks are in sync (clock skew can make the token expire early)
How do I join multiple channels at once?
Calljoin multiple times on one SRTC instance. Each join returns that channel’s Channel object, and each channel is operated independently: