For details about browser support, please see Browsers Supported.
If your browser is not listed in the above document, you can open the TRTC compatibility check page with the browser to test whether it fully supports WebRTC.
Please see Environment and Device Check Before Calls.
Please see Network Quality Check Before Calls.
To ensure data security and protect users’ privacy, browsers allow access to the mic and camera only in secure environments, for example, when https
, localhost
, or file://
is used for access. Because HTTP is not secure, browsers block access to media devices when HTTP is used.
If you can use the SDK in a local development environment but cannot capture data from the camera or mic after deploying it to the web, check whether your webpage is deployed using HTTP. If so, use HTTPS instead and make sure you have a valid HTTPS certificate.
For more information, see Domain Name and Protocol Support.
You can refer to startMixTranscode, Publishing to CDN, Enabling Dual-Channel Mode, Enabling Beauty Filters, and Enabling Watermarking to enable the advanced features.
See WebRTC Known Issues and Solutions.
NotFoundError
, NotAllowedError
, NotReadableError
, OverConstrainedError
, and AbortError
found in the log of the TRTC web SDK mean?Error | Description | Suggested Solution |
---|---|---|
NotFoundError | The media (audio, video, or screen sharing) specified by the request parameter are not found. This error occurs if, for example, the PC has no cameras but the browser is asked to obtain a video stream. | Remind users to check devices such as cameras and mics before making a call. If a user does not have a camera and wants to make an audio call, use TRTC.createStream({ audio: true, video: false}) to make the SDK capture audio only. |
NotAllowedError | The user has rejected the request of the current browser instance to access the camera/mic or share screens. | Remind the user that audio/video calls are not possible without camera/mic access. |
NotReadableError | The user has granted access to the requested device, but it is still inaccessible due to a hardware, browser, or webpage error. | Handle the error according to the error message returned, and send this message to the user: “The camera/mic cannot be accessed. Please make sure that no other applications are requesting access and try again.” |
OverConstrainedError | The cameraId /microphoneId value is invalid. |
Make sure that a valid cameraId /microphoneId value is passed in. |
AbortError | The device cannot be accessed due to an unknown reason. | - |
For more information, see initialize.
For details about browser support, see Browsers Supported.
If your browser is not listed in the above document, you can open the TRTC compatibility check page with the browser to test whether it fully supports WebRTC.
The resolution set may be unattainable due to device and browser restrictions, in which case the browser will adjust the resolution to make it as close as possible to the target. For details, see setVideoProfile.
No. The style of screen sharing is controlled by browsers and cannot be modified.
Yes, it does. For details, see startMixTranscode.
You can call TRTC.getCameras to see if you can get the new device list. If there is still information of the disconnected camera, it indicates that the browser has not refreshed the list and the SDK cannot get the new device list.
To learn whether the built-in browser of WeChat for iOS supports publishing or playback, please see Browsers Supported.
Stream.resume()
to resume audio playback. For details, please see Suggested Solutions for Autoplay Restrictions.audioLevel
and audioEnergy
of the sender and recipient in the dashboard.Check whether the webpage has obtained any data. If data can be sent and received successfully, check whether the correct mediaStream
object is assigned to the srcObject
property of <video>
. Video will not be displayed if srcObject
is incorrect.
These issues are common if the call participants are close to each other. Please ensure a certain distance between call participants when testing. If a non-web client hears echo or noise from a web client, it indicates that 3A is not working on the web end.
If you use the browser’s built-in API getUserMedia for custom capturing, you need to enable 3A manually using the parameters below:
echoCancellation
: echo cancellationnoiseSuppression
: noise suppressionautoGainControl
: automatic gain control. For detailed directions, see MediaTrackConstraints.If you use the TRTC.createStream API for capturing, you don’t need to set the 3A parameters manually. The TRTC SDK enables 3A by default.
Because Chrome has deprecated Plan B since v96, the earlier versions (2.x and 3.x) of the TRTC web SDK can no longer make calls on Chrome 96+. Please update your SDK to the latest version (4.x). The APIs of v4.x are not compatible with those of v2.x or v3.x. For how to integrate v4.x, see SDK Quick Integration.
It indicates that the TRTC web SDK failed to punch a hole via Session Traversal Utilities for NAT (STUN). Please check your firewall configuration. The ports and domain name listed in the document below must be added to the allowlist of your firewall because the SDK uses them for data transfer. After configuration, use the official demo to check whether the configuration has taken effect.
For details, see Dealing with Firewall Restrictions.
It indicates that TRTC SDK for web failed to establish a media transport connection. Please check your firewall configuration. The ports and domain name listed in the document below must be added to the allowlist of your firewall as the SDK uses them for data transfer. After configuration, use the official demo to check whether the configuration has taken effect.
For details, please see Dealing with Firewall Restrictions.
You can use getAudioLevel to get the current volume. For details, please see Detecting Volume.
Client.on(‘client-banned’)
event?The event is triggered when a user is removed from a room, for example, when the same user ID is used to log in from different devices or when the RESTful API RemoveUser is called to remove a user.
Note:Repeated login is not allowed by the SDK (it may cause call exceptions) and should be avoided at the business layer.
For more information, see CLIENT_BANNED.
Yes. You can use the client.on('peer-leave') event to receive notifications when a remote user exits the room.
Yes. TRTC supports communication across all platforms.
You can use the Stream.getVideoFrame() API to take a screenshot.
Set the pureAudioPushMode
parameter of createClient.
Client.on(‘error’)
?It indicates that the SDK encountered an unrecoverable error. You can refresh the page or call Client.leave
to leave the room and then call Client.join
to try again.
The TRTC web SDK has supported custom stream ID since v4.3.8. You can update your SDK to use the feature. The TRTC Mini Program SDK does not support custom stream ID currently.
See Capturing System Audio During Screen Sharing.
Currently, system audio capturing is supported on Chrome M74+ only. On Chrome for Windows and Chrome OS, you can capture the audio of the entire system, while on Chrome for Linux and macOS, you can capture only the audio of Chrome tabs. Other Chrome versions, OS, and browsers do not support system audio capturing.
You can first get the system’s cameras and mics and call switchDevice to switch the camera/mic. For detailed directions, please see Switching Cameras/Mics.
To use WebRTC in iframes, you need to add the following attribute to the iframe tag to obtain the permissions needed.
Mic, camera, and screen sharing permissions:
<iframe allow="microphone; camera; display-capture;">
Was this page helpful?