Package com.twilio.video
Class RemoteVideoTrack
- java.lang.Object
-
- com.twilio.video.VideoTrack
-
- com.twilio.video.RemoteVideoTrack
-
- All Implemented Interfaces:
Track
public class RemoteVideoTrack extends VideoTrack
A remote video track represents a remote video source.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSink(VideoSink videoSink)Add a video sink to receive frames from the video track.TrackPrioritygetPriority()Get the subscriber'sTrackPriorityfor thisRemoteVideoTrack.java.lang.StringgetSid()Returns the remote video track's server identifier.booleanisSwitchedOff()Return whether the track is switched off.voidremoveSink(VideoSink videoSink)Remove a video sink to stop receiving video from the video track.voidsetContentPreferences(VideoContentPreferences videoContentPreferences)Sets theVideoContentPreferencesfor theRemoteVideoTrack.voidsetPriority(TrackPriority priority)Set the subscriber'sTrackPriorityfor thisRemoteVideoTrack.voidswitchOff()Request to switch off aRemoteVideoTrack, if it is currently switched on.voidswitchOn()Request to switch on aRemoteVideoTrack, if it is currently switched off.-
Methods inherited from class com.twilio.video.VideoTrack
getName, getSinks, isEnabled
-
-
-
-
Method Detail
-
getSid
@NonNull public java.lang.String getSid()
Returns the remote video track's server identifier. This value uniquely identifies the remote video track within the scope of aRoom.
-
addSink
public void addSink(@NonNull VideoSink videoSink)Description copied from class:VideoTrackAdd a video sink to receive frames from the video track.- Overrides:
addSinkin classVideoTrack- Parameters:
videoSink- video sink that receives video.
-
removeSink
public void removeSink(@NonNull VideoSink videoSink)Description copied from class:VideoTrackRemove a video sink to stop receiving video from the video track.- Overrides:
removeSinkin 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 theClientTrackSwitchOffControlis set toClientTrackSwitchOffControl.MANUALin video bandwidth profile options. Tracks may still remain switched off when available bandwidth is limited.- Throws:
java.lang.IllegalStateException- if the following preconditions exist:BandwidthProfileOptionshas not been set.ClientTrackSwitchOffControl.AUTOis 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 theClientTrackSwitchOffControlis set toClientTrackSwitchOffControl.MANUALin video bandwidth profile options.- Throws:
java.lang.IllegalStateException- if the following preconditions exist:BandwidthProfileOptionshas not been set.ClientTrackSwitchOffControl.AUTOis set.VideoBandwidthProfileOptions.Builder.maxTracks(Long)is set.
-
setContentPreferences
public void setContentPreferences(VideoContentPreferences videoContentPreferences)
Sets theVideoContentPreferencesfor theRemoteVideoTrack. This method must be called only if theVideoContentPreferencesModeis set toVideoContentPreferencesMode.MANUALin video bandwidth profile options.- Parameters:
videoContentPreferences- TheVideoContentPreferencesfor thisRemoteVideoTrack.- Throws:
java.lang.IllegalStateException- if the following preconditions exist:BandwidthProfileOptionshas not been set.VideoContentPreferencesMode.AUTOis set.VideoBandwidthProfileOptions.Builder.renderDimensions(Map)is set.
-
isSwitchedOff
public boolean isSwitchedOff()
Return whether the track is switched off.
-
getPriority
@Nullable public TrackPriority getPriority()
Get the subscriber'sTrackPriorityfor thisRemoteVideoTrack. The default subscriber priority isnull, which indicates that the subscriber has not set a priority for thisRemoteVideoTrack.
-
setPriority
public void setPriority(@Nullable TrackPriority priority)Set the subscriber'sTrackPriorityfor thisRemoteVideoTrack. Providingnullclears the subscriber'sTrackPriorityfor thisRemoteVideoTrack. This method is a no-op if theRemoteVideoTrackhas been unsubscribed from.- Parameters:
priority- The priority to be set.
-
-