Package com.twilio.video
Class RemoteVideoTrack
java.lang.Object
com.twilio.video.VideoTrack
com.twilio.video.RemoteVideoTrack
- All Implemented Interfaces:
Track
A remote video track represents a remote video source.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a video sink to receive frames from the video track.Get the subscriber'sTrackPriority
for thisRemoteVideoTrack
.getSid()
Returns the remote video track's server identifier.boolean
Return whether the track is switched off.void
removeSink
(VideoSink videoSink) Remove a video sink to stop receiving video from the video track.void
setContentPreferences
(VideoContentPreferences videoContentPreferences) Sets theVideoContentPreferences
for theRemoteVideoTrack
.void
setPriority
(TrackPriority priority) Set the subscriber'sTrackPriority
for thisRemoteVideoTrack
.void
Request to switch off aRemoteVideoTrack
, if it is currently switched on.void
switchOn()
Request to switch on aRemoteVideoTrack
, if it is currently switched off.Methods inherited from class com.twilio.video.VideoTrack
constructBlackFrame, getName, getSinks, isEnabled
-
Method Details
-
getSid
Returns the remote video track's server identifier. This value uniquely identifies the remote video track within the scope of aRoom
. -
addSink
Description copied from class:VideoTrack
Add a video sink to receive frames from the video track.- Overrides:
addSink
in classVideoTrack
- Parameters:
videoSink
- video sink that receives video.
-
removeSink
Description copied from class:VideoTrack
Remove a video sink to stop receiving video from the video track.- Overrides:
removeSink
in classVideoTrack
- Parameters:
videoSink
- the video sink that should no longer receive video.
-
switchOn
public void switchOn()Request to switch on aRemoteVideoTrack
, if it is currently switched off. This method must be called only if theClientTrackSwitchOffControl
is set toClientTrackSwitchOffControl.MANUAL
in video bandwidth profile options. Tracks may still remain switched off when available bandwidth is limited.- Throws:
IllegalStateException
- if the following preconditions exist:BandwidthProfileOptions
has not been set.ClientTrackSwitchOffControl.AUTO
is set.VideoBandwidthProfileOptions.Builder.maxTracks(Long)
is set.
-
switchOff
public void switchOff()Request to switch off aRemoteVideoTrack
, if it is currently switched on. This method must be called only if theClientTrackSwitchOffControl
is set toClientTrackSwitchOffControl.MANUAL
in video bandwidth profile options.- Throws:
IllegalStateException
- if the following preconditions exist:BandwidthProfileOptions
has not been set.ClientTrackSwitchOffControl.AUTO
is set.VideoBandwidthProfileOptions.Builder.maxTracks(Long)
is set.
-
setContentPreferences
Sets theVideoContentPreferences
for theRemoteVideoTrack
. This method must be called only if theVideoContentPreferencesMode
is set toVideoContentPreferencesMode.MANUAL
in video bandwidth profile options.- Parameters:
videoContentPreferences
- TheVideoContentPreferences
for thisRemoteVideoTrack
.- Throws:
IllegalStateException
- if the following preconditions exist:BandwidthProfileOptions
has not been set.VideoContentPreferencesMode.AUTO
is set.VideoBandwidthProfileOptions.Builder.renderDimensions(Map)
is set.
-
isSwitchedOff
public boolean isSwitchedOff()Return whether the track is switched off. -
getPriority
Get the subscriber'sTrackPriority
for thisRemoteVideoTrack
. The default subscriber priority isnull
, which indicates that the subscriber has not set a priority for thisRemoteVideoTrack
. -
setPriority
Set the subscriber'sTrackPriority
for thisRemoteVideoTrack
. Providingnull
clears the subscriber'sTrackPriority
for thisRemoteVideoTrack
. This method is a no-op if theRemoteVideoTrack
has been unsubscribed from.- Parameters:
priority
- The priority to be set.
-