This page provides the release notes for the Agora Web SDK 4.x.
The Web SDK 4.x is a JavaScript and TypeScript library loaded by an HTML web page. The SDK library uses APIs in the web browser to establish connections and control the communication and interactive live streaming services.
Compatibility
For the web browser support of the Web SDK 4.x, see Which browsers does the Agora Web SDK support?
v4.3.0 was released on January 26, 2021.
Cloud proxy
This release optimizes the Agora cloud proxy architecture and enhances the connectivity of the Web SDK in environments with restricted network access. The optimized Agora cloud proxy service also supports regional connection.
You can contact support@agora.io to apply for using the optimized Agora cloud proxy service and set the mode
parameter as 3
when calling startProxyServer
. For details, see Use Cloud Proxy.
v4.2.0 was released on December 23, 2020. This release fixed the incorrect error that the SDK throws when you pass an illegal parameter in the client.publish method.
v4.2.0 was released on December 1, 2020.
Regional connection
This release adds the AgoraRTC.setArea
method for specifying the region for connection. After specifying the region, the SDK connects to the Agora servers within that region. The following regions are supported:
This advanced feature applies to scenarios that have regional restrictions.
Video transmission optimization strategy
This release adds the localVideoTrack.setOptimizationMode
method for setting the video transmission optimization mode:
"balanced"
: Uses the default transmission optimization strategy."detail"
: Prioritizes clarity."motion"
: Prioritizes smoothness.See the API reference for the introduction to each transmission optimization mode. This method applies to scenarios where you need to dynamically adjust the optimization mode during a video call, live streaming, or screen sharing. For example, during the screen sharing, before you change the shared content from slides to a video, you can change the optimization mode from "detail"
to "motion"
to ensure smoothness in poor network conditions.
Network quality of remote users
This release adds the AgoraRTCClient.getRemoteNetworkQuality
method for getting the uplink and downlink network quality of all the remote users to whom the local user subscribes.
Cloud proxy
This release changes the mode
parameter of the AgoraRTCClient.startProxyServer
method from boolean
to number
.
setEnabled
, you can still call setDevice
to switch devices.AgoraRTCClient.setEncryptionConfig
to enable the built-in encryption, when the user uses a weak secret, the SDK outputs a warning message to the Web Console and prompts the user to use a strong secret. A strong secret must contain at least eight characters and be a combination of uppercase and lowercase letters, numbers, and special characters.setEnabled(false)
to disable a video track during the process of publishing, the publishing failed and could not be recovered.BufferSourceAudioTrack
could be distorted.onMicrophoneChanged
, onCameraChanged
, or onPlaybackDeviceChanged
). The SDK only triggered these events for a subsequent device change.Added
AgoraRTC.setArea
localVideoTrack.setOptimizationMode
AgoraRTCClient.getRemoteNetworkQuality
Changed
mode
parameter in AgoraRTCClient.startProxyServer
from boolean
to number
v4.1.1 was released on October 27, 2020. This release fixed the following issues:
event_network_quality
event.createCameraVideoTrack
did not stop on Safari when the SDK cannot find a video capture device.unsubscribe
to unsubscribing from an unpublished track of a remote user, the subsequent subscribing and unsubscribing operations failed to take effect.setEnabled
to enable and disable a video track in dual-stream mode.client.getLocalVideoStats
was called on Safari.v4.1.0 was released on September 4, 2020.
Screenshot capture
v4.1.0 adds the getCurrentFrameData
method which gets the data of the video frame being rendered.
Audio playback device management
v4.1.0 adds the following APIs to manage audio playback devices:
setPlaybackDevice
: Sets the audio playback device, for example, the speaker. This method supports Chrome only.getPlaybackDevices
: Retrieves the audio playback devices available.onPlaybackDeviceChanged
: Occurs when an audio playback device is added or removed.network-quality
event.checkVideoTrackIsActive
on Safari is inaccurate.setEnabled
after leaving the channel.UNEXPECTED_RESPONSE: ERR_SUBSCRIBE_REQUEST_INVALID
error.Added
LocalVideoTrack.getCurrentFrameData
RemoteVideoTrack.getCurrentFrameData
AgoraRTC.getPlaybackDevices
LocalAudioTrack.setPlaybackDevice
RemoteAudioTrack.setPlaybackDevice
AgoraRTC.onPlaybackDeviceChanged
Client.getLocalAudioStats
Client.getRemoteAudioStats
Client.getLocalVideoStats
Client.getRemoteVideoStats
Deprecated
LocalTrack.getStats
and RemoteTrack.getStats
methods. Use the Client.getLocalAudioStats
, Client.getRemoteAudioStats
, Client.getLocalVideoStats
and Client.getRemoteVideoStats
methods instead.v4.0.1 was released on July 18, 2020. This release fixed the following issues:
v4.0.0 was released on July 15, 2020.
v4.0.0 deletes the LocalTrack.setMute
method and adds the LocalTrack.setEnabled
method for enabling or disabling a local track. The advantages of this change are as follows:
Client.on("user-mute-updated")
callback when the remote user calls setMute
to change the mute state.Client.on("user-unpublished")
or Client.on("user-published")
callbacks when the remote user calls setEnabled
to enable or disable a track.setMute(true)
, the SDK sends black video frames or silenced audio frames. If you mute a local video track, the camera light stays on, which might adversely impact the user experience. In contrast, if you disable a local video track by calling setEnabled(false)
, the SDK immediately turns off the camera and stops capturing video.The
setEnabled
method changes media input behaviors, so it is an asynchronous operation and returns the result through thePromise
object.
Video encoding strategy
v4.0.0 adds the optimizationMode
property in the CameraVideoTrackInitConfig
, ScreenVideoTrackInitConfig
, and CustomVideoTrackInitConfig
interfaces. When creating a video track by calling createCameraVideoTrack
, createCustomVideoTrack
, or createScreenVideoTrack
, you can choose whether to prioritize video quality or smoothness by setting optimizationMode as the following:
"detail"
: Prioritizes video quality."motion"
: Prioritizes video smoothness.The
optimizationMode
property of the video track created by calling createScreenVideoTrack is set as"detail"
by default.
withAudio
parameter in AgoraRTC.createScreenVideoTrack
. In addition to enable
and disable
, you can also set withAudio
as auto
. In this setting, the SDK shares the audio, dependent on whether the browser supports this function. withAudio
parameter as "all"
any more to avoid code repetition. As of v4.0.0, you can only set withAudio
as "audio"
or "video"
. This change involves the following APIs:Client.subscribe
method.Client.on("user-published")
and Client.on("user-unpublished")
callbacks.v4.0.0 fixed the following issues:
unpublish
, the SDK triggerred the Client.on("user-left")
callback on the remote side."rtc"
mode.publish
and unpublish
frequently.Client.on("network-quality")
callback was inaccurate.Added
Client.localTracks
interfaceLocalTrack.setEnabled
methodoptimizationMode
property in CameraVideoTrackInitConfig, ``ScreenVideoTrackInitConfig
, and CustomVideoTrackInitConfig
interfacesUpdated
auto
to the withAudio parameter in AgoraRTC.createScreenVideoTrack
."all"
from the mediaType parameter in Client.subscribe
.mediaType
parameter in the Client.on("user-published")
and Client.on("user-unpublished")
callbacks does report "all"
Deprecated
LocalAudioTrackStats.muteState
propertyLocalVideoTrackStats.muteState
propertyRemoteAudioTrackStats.muteState
propertyRemoteVideoTrackStats.muteState
propertyDeleted
Client.on("user-mute-updated")
callbackLocalTrack.setMute
methodAgoraRTCRemoteUser.audioMuted
propertyAgoraRTCRemoteUser.videoMuted
propertyLocalTrack.getUserId
method