Class: RemoteVideoTrack

RemoteVideoTrack

A RemoteVideoTrack represents a VideoTrack published to a Room by a RemoteParticipant.

Extends

Methods


attach()

Create an HTMLVideoElement and attach the VideoTrack to it.

The HTMLVideoElement's srcObject will be set to a new MediaStream containing the VideoTrack's MediaStreamTrack.

Inherited From:
Overrides:
Returns:

videoElement

Type
HTMLVideoElement
Example
const Video = require('twilio-video');

Video.createLocalVideoTrack().then(function(videoTrack) {
  const videoElement = videoTrack.attach();
  document.body.appendChild(videoElement);
});
  

detach()

Detach the VideoTrack from all previously attached HTMLMediaElements.

Inherited From:
Overrides:
Returns:

mediaElements

Type
Array.<HTMLMediaElement>
Example
const mediaElements = videoTrack.detach();
mediaElements.forEach(mediaElement => mediaElement.remove());
  

Events


dimensionsChanged

The RemoteVideoTrack's dimensions changed.

Parameters:
Name Type Description
track RemoteVideoTrack

The RemoteVideoTrack whose dimensions changed

Overrides:

disabled

The RemoteVideoTrack was disabled, i.e. "paused".

Parameters:
Name Type Description
track RemoteVideoTrack

The RemoteVideoTrack that was disabled

Overrides:

enabled

The RemoteVideoTrack was enabled, i.e. "unpaused".

Parameters:
Name Type Description
track RemoteVideoTrack

The RemoteVideoTrack that was enabled

Overrides:

started

The VideoTrack started. This means there is enough video data to begin playback.

Parameters:
Name Type Description
track VideoTrack

The VideoTrack that started

Inherited From:
Overrides: