OpenTok.Stream
Copy
public class Stream : IDisposable
The Session object sends the Session.StreamReceived event when there is a new stream in the session. This object only represents the stream at the moment of the callback.
The Session sends a Session.StreamDropped event when a stream is dropped from the session (for example, when it is unpublished). Again, this instance only represents the stream at the moment of the callback.
Properties
| Name | Type | Description |
|---|---|---|
Id |
string | { get; } The unique identifier for this stream. |
Name |
string | { get; } The name of the stream. You can display this name to identify the stream's publisher. |
HasCaptions |
bool | { get; } Whether this stream has captions (true) or not (false). |
HasAudio |
bool | { get; } Whether audio is enabled (true) or disabled (false) in the stream. Add an event listener for the Session.StreamHasAudioChanged event to detect changes in the HasAudio property. |
HasVideo |
bool | { get; } Whether video is enabled (true) or disabled (false) in the stream. Add an event listener for the Session.StreamHasVideoChanged event to detect changes in the HasVideo property. |
Width |
int | { get; } This value can change at runtime when the publisher changes the capture resolution, for example due to a device orientation change or a change in capture settings. Add an event listener for the Session.StreamDimensionsChanged event to detect changes in the Width or Height properties. Note: This represents the publisher's capturer target resolution, not the resolution actually encoded or received by a subscriber. The publisher may encode at a lower resolution due to bandwidth or CPU constraints. 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. |
Height |
int | { get; } This value can change at runtime when the publisher changes the capture resolution, for example due to a device orientation change or a change in capture settings. Add an event listener for the Session.StreamDimensionsChanged event to detect changes in the Width or Height properties. Note: This represents the publisher's capturer target resolution, not the resolution actually encoded or received by a subscriber. The publisher may encode at a lower resolution due to bandwidth or CPU constraints. 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. |
CreationTime |
DateTime | { get; } The creation time of this stream. |
VideoSourceType |
VideoSourceType | { get; } The video source type of the stream (camera, screen, custom), as defined by the OpenTok.VideoSourceType enum. |
Connection |
Connection | { get; } The Connection object corresponding to the client that is publishing the stream. You can always use this to retrieve the connection even beyond the scope of the callback where this Stream object was received. |
Methods
| Name | Description |
|---|---|
Dispose(disposing) |
|
Dispose() |
Disposes of the Stream object's resources. |
Equals(obj) → {override bool} |
|
GetHashCode() → {override int} |
Dispose(disposing)
Parameters:
| Name | Type | Description |
|---|---|---|
disposing |
bool |
Dispose()
Disposes of the Stream object's resources.
Equals(obj) → {override bool}
Parameters:
| Name | Type | Description |
|---|---|---|
obj |
object |
Returns:
override bool
GetHashCode() → {override int}
Returns:
override int