public final class Stream
extends java.lang.Object
Session.SessionListener.onStreamReceived(Session session, Stream stream)
method notifies you of new streams in the session:
public void receivedStream(Session session, Stream stream) { Subscriber subscriber = new Subscriber(context, stream); session.subscribe(subscriber); }
The Session.SessionListener.onStreamDropped(Session session, Stream stream)
method notifies
when streams are unpublished the session.
Modifier and Type | Class and Description |
---|---|
static class |
Stream.StreamVideoType
Defines values for the
getStreamVideoType() method. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
protected void |
finalize() |
Connection |
getConnection()
Returns the
Connection object corresponding to this Stream. |
java.util.Date |
getCreationTime()
Returns the time when this stream first joined the OpenTok session.
|
java.lang.String |
getName()
The name of the stream.
|
Session |
getSession()
Deprecated.
|
java.lang.String |
getStreamId()
Gets a unique identifier for this stream.
|
Stream.StreamVideoType |
getStreamVideoType()
Specifies the type of video for this stream.
|
int |
getVideoHeight()
The height of the stream, in pixels.
|
int |
getVideoWidth()
The width of the stream, in pixels.
|
boolean |
hasAudio()
Whether this stream has audio (
true ) or not (false ). |
int |
hashCode() |
boolean |
hasVideo()
Whether this stream has video (
true ) or not (false ). |
java.lang.String |
toString() |
public java.lang.String getStreamId()
public java.util.Date getCreationTime()
public boolean hasVideo()
true
) or not (false
).public boolean hasAudio()
true
) or not (false
).public Connection getConnection()
Connection
object corresponding to this Stream.
Compare the Connection object returned by the getConnection()
method with the Connection
object returned by Sesssion.getConnection()
to see if
the new stream is published by your client.
Connection
object corresponding to this Stream.Session.getConnection()
public java.lang.String getName()
By default, this name appears when the user taps the video display of the stream.
However, you can call the SubscriberKit.setStyle(String key, String value)
or
SubscriberKit.setStyle(String key, String value)
(with the key
parameter
set to BaseVideoRenderer.STYLE_NAME_DISPLAY
) to change this behavior.
public int getVideoWidth()
For streams published using the scalable video feature, this is set to the width of the maximum resolution available for the stream. For more information on scalable video, see the documentation for the OpenTok Media Router.
public int getVideoHeight()
For streams published using the scalable video feature, this is set to the height of the maximum resolution available for the stream. For more information on scalable video, see the documentation for the OpenTok Media Router.
@Deprecated public Session getSession()
public Stream.StreamVideoType getStreamVideoType()
StreamVideoType.StreamVideoTypeScreen
— The stream's video
encoding is optimized for screen sharing.StreamVideoType.StreamVideoTypeCamera
— The stream is not
optimized for screen sharing (for example, it uses a camera as the video source).public java.lang.String toString()
toString
in class java.lang.Object
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object