Web SDK

更新时间:
复制 MD 格式

DingRTC

DingRTC is the entry point for all callable interfaces in the Real-Time Communication (RTC) Web SDK.

Core interfaces

Interface

Description

createClient()

Creates a local client

Local audio and video capture

Interface

Description

createMicrophoneAudioTrack()

Creates a microphone audio track object

createCameraVideoTrack()

Creates a camera video track object

createMicrophoneAndCameraTracks()

Creates both a microphone audio track and a camera video track

createScreenVideoTrack()

Creates a screen-sharing track object

createCustomAudioTrack()

Creates a custom audio track object

createCustomVideoTrack()

Creates a custom video track object

Media device query

Interface

Description

getDevices()

Gets the list of media devices

getCameras()

Gets the list of camera devices

getMicrophones()

Gets the list of microphone devices

getPlaybackDevices()

Gets the list of speaker devices

Global event callbacks

Callback

Description

"camera-changed"

Callback for camera device status changes

"microphone-changed"

Callback for microphone device status changes

"autoplay-failed"

Callback for autoplay failure

"playback-device-changed"

Changing the speaker device

Others

Interface

Description

checkSystemRequirements()

Checks browser compatibility

setLogLevel()

Sets the log level

DingRTCClient

You can call createClient() to create a DingRTCClient object. This object represents a local user in a call and provides core features for audio and video calls. It includes the following interfaces:

Interface

Description

join()

Joins a channel

leave()

Leaves a channel

publish()

Publishes local audio and video tracks

unpublish()

Unpublishes local audio and video tracks

subscribe()

Subscribes to the audio and video tracks of a remote user

unsubscribe()

Unsubscribes from the audio and video tracks of a remote user

LocalTrack class

The `LocalTrack` is the base class for local audio and video tracks in the SDK. It is used for local playback and publishing. You can create various local audio and video tracks, which return different objects derived from the `LocalTrack` class. The following list describes the related classes and their creation methods.

RemoteTrack class

RemoteTrack is the base class for remote audio and video tracks defined in the SDK.

When developing an application, first call subscribe() to subscribe to a remote user. Then, retrieve the RemoteVideoTrack object and RemoteAudioTrack object from the RemoteUser object. These objects are derived from the `RemoteTrack` class.