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 void
addSink(VideoSink videoSink)
Add a video sink to receive frames from the video track.TrackPriority
getPriority()
Get the subscriber'sTrackPriority
for thisRemoteVideoTrack
.java.lang.String
getSid()
Returns the remote video track's server identifier.boolean
isSwitchedOff()
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
switchOff()
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
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:VideoTrack
Add a video sink to receive frames from the video track.- Overrides:
addSink
in classVideoTrack
- Parameters:
videoSink
- video sink that receives video.
-
removeSink
public void removeSink(@NonNull VideoSink videoSink)
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:
java.lang.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:
java.lang.IllegalStateException
- if the following preconditions exist:BandwidthProfileOptions
has not been set.ClientTrackSwitchOffControl.AUTO
is set.VideoBandwidthProfileOptions.Builder.maxTracks(Long)
is set.
-
setContentPreferences
public void setContentPreferences(VideoContentPreferences videoContentPreferences)
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:
java.lang.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
@Nullable public TrackPriority 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
public void setPriority(@Nullable TrackPriority priority)
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.
-
-