The remote video track. Get this object from the DingRTCRemoteUser.videoTrack property after calling subscribe.
Inherits from:RemoteTrack
Properties
Property | Type | Description | Minimum supported version |
isPlaying | boolean | Indicates whether the MediaStreamTrack is currently playing. | 1.0.0 |
Methods
Method | Description | Minimum supported version |
Gets the current video frame data. | ||
Gets the user ID. | 1.0.0 | |
Gets the track ID. | 1.0.0 | |
Plays the video track in a specified DOM element. | 1.0.0 | |
Stops playback. | 1.0.0 | |
Removes a listener for a specified event. | 1.0.0 | |
Registers a listener for a specified event. | 1.0.0 | |
Registers a listener that is invoked only once for an event. | 1.0.0 | |
Removes all listeners for a specified event, or for all events if none is specified. | 1.0.0 | |
Registers a listener for the first video frame event. | 1.0.0 |
Method details
getCurrentFrameData()
Gets the current video frame data.
Type signature
getCurrentFrameData(): string;
Returns
string
An image/png data URL.
getMediaStreamTrack()
Gets the underlying MediaStreamTrack object.
Type signature
getMediaStreamTrack(): MediaStreamTrack;
Returns
MediaStreamTrack
The MediaStreamTrack object.
getUserId()
Gets the user ID.
Type signature
getUserId(): string;
Returns
string
The user ID.
getTrackId()
Gets the track ID.
Type signature
getTrackId(): string;
Returns
string
The track ID.
play()
Plays the video track in a specified DOM element.
Type signature
play(element?: string | HTMLElement, config?: VideoPlayerConfig): void;
Parameters
Parameter | Type | Description |
element | string | HTMLElement | (Optional) Specifies the DOM element where the video track will be played. The SDK creates a - The element's ID (a - The element object itself ( |
config | (Optional) Video player configuration. |
Returns
void
replaceTrack()
Replaces the underlying MediaStreamTrack.
Type signature
replaceTrack(track: MediaStreamTrack, stopOldTrack?: boolean): void;
Parameter | Type | Description |
track | MediaStreamTrack | The new MediaStreamTrack to use. |
stopOldTrack | boolean | (Optional) Whether to stop the previous track. |
Returns
void
stop()
Stops playback.
Type signature
stop(): void;
Returns
void
on()
Registers a listener for a specified event.
Type signature
on(event: string, fn: Function): void;
Parameters
Parameter | Type | Description |
event | string | The event to listen for. |
fn | Function | The listener to execute when the event is triggered. |
Returns
void
off()
Removes a listener for a specified event.
Type signature
off(event: string, fn: Function): void;
Parameters
Parameter | Type | Description |
event | string | The event from which to remove the listener. |
fn | Function | The listener to remove. |
Returns
void
once()
Registers a listener that is invoked only once for an event.
Type signature
once(event: string, fn: Function): void;
Parameters
Parameter | Type | Description |
event | string | The event to listen for. |
fn | Function | The listener to execute. |
Returns
void
removeAllListeners()
Removes all listeners for a specified event, or for all events if none is specified.
Type signature
removeAllListeners(event?: string): void;
Parameters
Parameter | Type | Description |
event | string | (Optional) The event to remove listeners from. If omitted, listeners for all events are removed. |
Returns
void
onFirstFrame()
Registers a listener for the first video frame event.
Type signature
onFirstFrame(): voidReturns
void