tencent cloud

Feedback

Overview

Last updated: 2022-09-26 15:49:45

    Supported Platforms

    The TRTC web SDK is based on WebRTC and can be used on mainstream desktop and mobile browsers. For details about browser support, see the table below. If your browser (for example, WebView) is not in the list, you can run a TRTC Web SDK Support Level Test in the browser to test whether it fully supports WebRTC.
    Operating System
    Browser
    Minimum BrowserVersion Requirements
    SDK Version Requirements
    Receive (Playback)
    Send (Publish)
    Share Screen
    Windows
    Chrome (desktop)
    56+
    N/A
    Supported
    Supported
    Supported on Chrome 72+
    QQ Browser (desktop, WebKit core)
    10.4+
    N/A
    Supported
    Supported
    Not supported
    Firefox (desktop)
    56+
    4.7.0+
    Supported
    Supported
    Supported on Firefox 66+
    Edge (desktop)
    80+
    4.7.0+
    Supported
    Supported
    Supported
    Sogou Browser (desktop, WebKit core)
    11+
    4.7.0+
    Supported
    Supported
    Supported
    Sogou Browser (Trident core)
    N/A
    N/A
    Not supported
    Not supported
    Not supported
    Opera (desktop)
    46+
    4.7.0+
    Supported
    Supported
    Supported on Opera 60+
    360 Secure Browser (Blink core)
    13+
    4.7.0+
    Supported
    Supported
    Supported
    360 Secure Browser (Trident core)
    N/A
    N/A
    Not supported
    Not supported
    Not supported
    WeChat built-in browser (desktop)
    N/A
    N/A
    Supported
    Not supported
    Not supported
    WeCom built-in browser (desktop)
    N/A
    N/A
    Supported
    Not supported
    Not supported
    macOS
    Safari (desktop)
    11+
    N/A
    Supported
    Supported
    Supported on Safari 13+
    Chrome (desktop)
    56+
    N/A
    Supported
    Supported
    Supported on Chrome 72+
    Firefox (desktop)
    56+
    4.7.0+
    Supported
    Supported
    Supported on Firefox 66+. (Note[3])
    Edge (desktop)
    80+
    4.7.0+
    Supported
    Supported
    Supported
    Opera (desktop)
    46+
    4.7.0+
    Supported
    Supported
    Supported on Opera 60+
    WeChat built-in browser (desktop)
    N/A
    N/A
    Supported
    Not supported
    Not supported
    WeCom built-in browser (desktop)
    N/A
    N/A
    Supported
    Not supported
    Not supported
    Android
    WeChat built-in browser (TBS core)
    N/A
    N/A
    Supported
    Supported
    Not supported
    WeChat built-in browser (XWEB core)
    N/A
    N/A
    Supported
    Supported
    Not supported
    WeCom built-in browser
    N/A
    N/A
    Supported
    Supported
    Not supported
    Chrome (mobile)
    N/A
    N/A
    Supported
    Supported
    Not supported
    QQ Browser (mobile)
    N/A
    N/A
    Not supported
    Not supported
    Not supported
    UC Browser (mobile)
    N/A
    N/A
    Not supported
    Not supported
    Not supported
    iOS 12.1.4+
    WeChat built-in browser
    N/A
    N/A
    Supported
    Not supported
    Not supported
    iOS 14.3+
    WeChat built-in browser
    WeChat 6.5+
    N/A
    Supported
    Supported
    Not supported
    iOS
    WeCom built-in browser
    N/A
    N/A
    Supported
    Not supported
    Not supported
    iOS 11.1.2+
    Safari (mobile)
    11+
    N/A
    Supported
    Supported
    Not supported
    iOS 12.1.4+
    Chrome (mobile)
    N/A
    N/A
    Supported
    Not supported
    Not supported
    iOS 14.3+
    Chrome (mobile)
    N/A
    N/A
    Supported
    Supported
    Not supported
    
    notice
    Due to H.264 copyright restrictions, H.264 encoding, which is required for stream publishing, is unavailable for Chrome versions earlier than v88 on Huawei devices. If you want to use the TRTC web SDK to publish streams on Chrome or Chrome WebView-based browsers on Huawei devices, please submit a ticket to enable VP8 encoding/decoding.
    Firefox for macOS performs poorly in terms of screen sharing, and no solution has been found yet. We recommend you use Chrome or Safari instead.
    If you want to add support for dual-channel encoding on web, please submit a ticket.
    For service stability and better online support, we recommend you to keep your SDK updated to the latest version. For notes on version updates, see Update Guide.

    URL Protocol Support

    Because of the security policies of browsers, when you use WebRTC, there are requirements on the protocol used for access. For details, see the table below.
    Scenario
    Protocol
    Receive (Playback)
    Send (Publish)
    Share Screen
    Remarks
    Production
    HTTPS
    Supported
    Supported
    Supported
    Recommended
    Production
    HTTP
    Supported
    Not supported
    Not supported
    
    Local development
    Supported
    Supported
    Supported
    Recommended
    Local development
    Supported
    Supported
    Supported
    
    Local development
    http://[local IP address]
    Supported
    Not supported
    Not supported
    
    Local development
    file:///
    Supported
    Supported
    Supported
    

    API Guide

    For details about the initialization process and the use of APIs, see the tutorials below:
    Feature
    Sample Code
    Audio/Video call
    Interactive live streaming
    Switching cameras/mics
    Setting local video attributes
    Disabling/Enabling local audio/video
    Screen sharing
    Measuring volume
    Custom capturing and rendering
    Limit on the number of upstream users in a room
    Adding background music and audio effects
    Environment and device check before calls
    Network quality check before calls
    Device change check
    Publishing to CDN
    Enabling dual-stream mode
    Enabling beauty filters
    Enabling watermarking
    Enabling cross-room communication
    Implementing On-Cloud MixTranscoding
    Implementing on-cloud recording
    explain
    Learn more about the features of the TRTC web SDK here.
    For FAQs, see Web.

    API Details

    TRTC

    notice
    This document applies to 4.x.x versions of the TRTC web SKD.
    TRTC is the main entry to the TRTC web SDK. You can use TRTC APIs to create a client object (Client) and local audio/video stream object (Stream) for real-time communication, check a browser's compatibility and whether it supports screen sharing, as well as set the log output level and enable/disable log upload.
    API
    Description
    Version of the TRTC web SDK
    Checks whether a browser is compatible with the TRTC web SDK. If not, ask users to download the latest version of Chrome.
    Checks whether a browser supports screen sharing. Call this API before creating a screen sharing stream.
    Checks whether a browser supports the dual-stream mode. Call this API before you enable the dual-stream mode.
    Gets the list of media input/output devices.
    Gets the list of cameras.
    Gets the list of mics.
    Gets the list of speakers.
    Creates a client object, which can enter a room, publish streams, subscribe to streams, and perform other actions.
    Creates a local Stream object, which uses the publish() API to publish the local audio/video stream.

    TRTC.Logger

    TRTC.Logger provides APIs for log settings, including log output level setting and log upload enabling/disabling.
    API
    Description
    Sets the log output level.
    Enables log upload.
    Disables log upload.

    Client

    A client object (Client) is created through createClient() and represents an audio/video call.
    API
    Description
    Sets proxy servers. You can use this API if you deploy proxy servers, e.g., Nginx + Coturn, by yourself.
    Sets TURN servers. This API is used together with setProxyServer(). You can use it if you deploy proxy and TURN servers by yourself.
    Enters a room. This starts an audio/video call. If the room does not exist, the system will create the room automatically.
    Exits a room. This ends an audio/video call.
    Publishes the local audio/video stream. You should call this API only after you call join() to enter a room. You can publish only one local stream per audio/video call.
    Stops publishing the local stream.
    Subscribes to a remote stream.
    Unsubscribes from a remote stream.
    Switches user roles. This API works only in interactive live streaming scenarios (live).
    Listens for client object events.
    Stops listening for client object events.
    Gets the audio/video status of remote users in a room.
    Gets data transfer statistics.
    Gets the audio statistics of the published local stream. This API can be used only after publish() is called.
    Gets the video statistics of the published local stream. This API can be used only after publish() is called.
    Gets the audio statistics of all remote streams.
    Gets the video statistics of all remote streams.
    Publishes the stream of the current client to CDN.
    Stops publishing the stream of the current client to CDN.
    Starts On-Cloud MixTranscoding. This API works only after stream publishing.
    Stops On-Cloud MixTranscoding. This API works only after successful local stream publishing (publish) and stream mixing (startMixTranscode).
    Enables/Disables the volume callback.
    Enables the dual-stream mode for publishing.
    Disables the dual-stream mode for publishing.
    Sets parameters for the low-quality stream.
    Switches between the low-quality stream and high-quality stream of a remote user. This API works only if a remote user enables the dual-stream mode.

    LocalStream

    A local audio/video stream is created through createStream. LocalStream is a subclass of Stream.
    API
    Description
    Initializes a local audio/video stream object.
    Sets audio parameters. This API works only if it is called before initialize().
    Sets video parameters. This API works only if it is called before initialize().
    Sets screen sharing parameters. This API works only if it is called before initialize().
    Sets video content hint, mainly in order to improve the video encoding quality in different scenarios. This method must be called before initialize() is called.
    Switches media input devices.
    Adds an audio or video track to the local stream.
    Removes the video track of the local stream.
    Replaces the audio or video track of the local stream.
    Starts playing the local audio/video stream.
    Stops playing the local audio/video stream.
    Resumes playing the local audio/video stream.
    Closes the local audio/video stream.
    Disables the audio track of the local stream.
    Disables the video track of the local stream.
    Enables the audio track of the local stream.
    Enables the video track of the local stream.
    Gets the stream ID.
    Gets the ID of the user to whom the stream belongs.
    Sets the audio output device.
    Gets the current volume. This API works only if there is audio data in the local stream or a remote stream.
    Queries whether there is an audio track.
    Queries whether there is a video track.
    Gets the audio track of the local stream.
    Gets the video track of the local stream.
    Gets the current video frame.
    Listens for stream events.
    Stops listening for stream events.

    RemoteStream

    A remote audio/video stream is obtained via the Client.on('stream-added') callback. RemoteStream is a subclass of Stream.
    API
    Description
    Gets the remote stream type. This method is mainly used to determine whether a remote stream is an audio/video primary stream or a video substream (which is usually a screen sharing stream).
    Starts playing an audio/video stream.
    Stops playing an audio/video stream.
    Resumes playing an audio/video stream.
    Closes an audio/video stream.
    Disables the audio track of a stream.
    Disables the video track of a stream.
    Enables the audio track of a stream.
    Enables the video track of a stream.
    Gets the stream ID.
    Gets the ID of the user to whom a stream belongs.
    Sets the audio output device.
    Sets the playback volume.
    Gets the current volume. This API works only if there is audio data in the local stream or a remote stream.
    Queries whether there is an audio track.
    Queries whether there is a video track.
    Gets the audio track of a stream.
    Gets the video track of a stream.
    Gets the current video frame.
    Listens for stream events.
    Stops listening for stream events.

    RtcError

    RtcError is the error object.
    API
    Description
    Gets the error code.

    ClientEvent

    A list of client events, which are also the values of eventName in the client.on('eventName') callback.
    API
    Description
    There was a new remote stream. This callback is triggered after a remote user starts publishing.
    A remote stream was removed. This callback is triggered after a remote user stops publishing.
    A remote stream was updated. This callback is triggered after a remote user adds, removes, or replaces an audio or video track.
    A remote stream was subscribed to. This callback is triggered after the local user calls subscribe() to successfully subscribe to a remote stream.
    The connection status between the local client and Tencent Cloud changed.
    A remote user entered the room.
    A remote user left the room.
    A remote user disabled their audio track. This callback is triggered after a remote user disables their audio track.
    A remote user disabled their video track. This callback is triggered after a remote user disables their video track.
    A remote user enabled their audio track. This callback is triggered after a remote user enables their audio track.
    A remote user enabled their video track. This callback is triggered after a remote user enables their video track.
    A user was removed from the room for one of the following reasons:
    A user with the same username entered the room. Note: Avoid repeated room entry with the same username because it will cause an error.
    The account admin called a server-side API to remove the user from the room.
    Callback of statistics on the quality of upstream and downstream data transfer. This callback is triggered every two seconds after room entry.
    Callback of user volumes.
    After you call the enableAudioVolumeEvaluation API to enable this callback, the SDK will return the volume of each user in the room at a regular interval.
    Error event. This callback is triggered if an unrecoverable error occurs. For details, see Error Codes.

    StreamEvent

    A list of stream events.
    API
    Description
    The status of the audio/video player changed.
    Local screen sharing stopped. This event is valid only for the local stream.
    The connection status of the stream changed. Listen for this event in stream-added and cancel listening for this event in stream-removed.
    Error event. This callback is triggered if an unrecoverable error occurs. For details, see Error Codes.

    Contact Us

    If you have any questions, please email us at colleenyu@tencent.com.
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support