/ fm / liveswitch / WebRtcStream
Class: WebRtcStream
fm.liveswitch.WebRtcStream
Hierarchy
-
↳ WebRtcStream
Implements
Table of contents
Constructors
Properties
Methods
- addOnDirectionChange
- addOnStateChange
- changeDirection
- getConnectedTimestamp
- getConnection
- getConnectionId
- getDirection
- getDynamicProperties
- getDynamicValue
- getExternalId
- getId
- getIsTerminated
- getIsTerminating
- getIsTerminatingOrTerminated
- getLabel
- getLocalDirection
- getLocalReceive
- getLocalSend
- getMediaDescriptionId
- getRemoteDirection
- getRemoteReceive
- getRemoteSend
- getState
- getTag
- getTransportInfo
- getType
- getTypeString
- processStateChange
- processStateLockChange
- removeOnDirectionChange
- removeOnStateChange
- setConnection
- setDynamicValue
- setExternalId
- setLocalDirection
- setLocalReceive
- setLocalSend
- setTag
- setTransportInfo
- toString
- unsetDynamicValue
Constructors
constructor
+ new WebRtcStream(type
: StreamType): WebRtcStream
Initializes a new instance of the [[fm.liveswitch.streamBase]] class.
Parameters:
Name | Type | Description |
---|---|---|
type |
StreamType | The type. |
Returns: WebRtcStream
Inherited from: WebRtcStreamBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStreamBase.ts:47
Properties
_mediaDescriptionManager
• Private
_mediaDescriptionManager: MediaDescriptionManager
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStream.ts:35
_transportInfo
• Private
_transportInfo: TransportInfo
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStream.ts:20
Methods
addOnDirectionChange
▸ addOnDirectionChange(value
: IAction0): void
Adds a handler that is raised when the stream direction changes.
Stream direction indicates the direction of media flow. For example:
- A stream in an SFU upstream connection has a direction of SendOnly.
- A stream in an SFU downstream connection has a direction of ReceiveOnly.
- A stream in an MCU connection has a direction of SendReceive if it is attached to both local and remote media. If it is only attached to local media, it has a direction of SendOnly. If it is only attached to remote media, it has a direction of ReceiveOnly.
- An update to an SFU upstream connection might instruct the stream to stop sending audio or video frames. In this case, the direction of the stream changes to Inactive.
- An update to an SFU downstream connection might cause it to stop receiving audio or video frames. In this case, the direction of the stream changes to Inactive.
- An update to an MCU upstream connection might instruct the stream to stop sending audio or video frames. In this case, the following occurs:
- If the direction of the stream was SendOnly, then the direction changes to Inactive.
- If the direction of the stream was ReceiveOnly, then the direction changes to SendReceive.
- An update to an MCU upstream connection might instruct it to stop receiving audio or video frames. In this case, the following occurs:
- If the direction of the stream was ReceiveOnly, then the direction changes to Inactive.
- If the direction of the stream was SendReceive, then the direction changes to SendOnly.
Parameters:
Name | Type |
---|---|
value |
IAction0 |
Returns: void
Implementation of: IInternalStream
Inherited from: WebRtcStreamBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStreamBase.ts:82
addOnStateChange
▸ addOnStateChange(value
: IAction0): void
Adds a handler that is raised when the connection state changes.
This method can track the state of the connection and can be used to display the current status of the connection to the user, add or remove media views in the UI, and handle retry logic if the connection fails.
Parameters:
Name | Type |
---|---|
value |
IAction0 |
Returns: void
Implementation of: IInternalStream
Inherited from: WebRtcStreamBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStreamBase.ts:95
changeDirection
▸ Abstract
changeDirection(newDirection
: StreamDirection): Error
Changes this stream's direction.
Parameters:
Name | Type |
---|---|
newDirection |
StreamDirection |
Returns: Error
Implementation of: IInternalStream
Inherited from: WebRtcStreamBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStreamBase.ts:107
getConnectedTimestamp
▸ Protected
getConnectedTimestamp(): number
Gets the ManagedStopwatch.GetTimestamp() value representing the ticks that passed when this stream's connection state changed to connected.
Returns: number
Inherited from: WebRtcStreamBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStreamBase.ts:114
getConnection
▸ getConnection(): WebRtcConnection
Returns: WebRtcConnection
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStream.ts:10
getConnectionId
▸ getConnectionId(): string
Gets the connection identifier.
Returns: string
Inherited from: WebRtcStreamBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStreamBase.ts:126
getDirection
▸ Abstract
getDirection(): StreamDirection
Gets the current direction.
Returns: StreamDirection
Implementation of: IInternalStream
Inherited from: WebRtcStreamBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStreamBase.ts:138
getDynamicProperties
▸ getDynamicProperties(): Hash<string, Object>
Gets all dynamic properties on this instance.
Returns: Hash<string, Object>
Inherited from: WebRtcStreamBase
Defined in: Generated/TypeScript/fm.liveswitch/Dynamic.ts:37
getDynamicValue
▸ getDynamicValue(key
: string): Object
Gets a property value from the local cache.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | The property key. This key is used internally only, but should be namespaced to avoid conflict with third-party extensions. |
Returns: Object
The stored value, if found; otherwise null.
Inherited from: WebRtcStreamBase
Defined in: Generated/TypeScript/fm.liveswitch/Dynamic.ts:58
getExternalId
▸ getExternalId(): string
Gets the external identifier.
Returns: string
Implementation of: IInternalStream
Inherited from: WebRtcStreamBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStreamBase.ts:146
getId
▸ getId(): string
Gets the identifier.
Returns: string
Implementation of: IInternalStream
Inherited from: WebRtcStreamBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStreamBase.ts:158
getIsTerminated
▸ getIsTerminated(): boolean
Gets a value indicating whether the stream is currently closed or failed.
Returns: boolean
Inherited from: WebRtcStreamBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStreamBase.ts:170
getIsTerminating
▸ getIsTerminating(): boolean
Gets a value indicating whether the stream is currently closing or failing.
Returns: boolean
Inherited from: WebRtcStreamBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStreamBase.ts:182
getIsTerminatingOrTerminated
▸ getIsTerminatingOrTerminated(): boolean
Gets a value indicating whether the stream is currently closing, failing, closed, or failed.
Returns: boolean
Inherited from: WebRtcStreamBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStreamBase.ts:194
getLabel
▸ Abstract
getLabel(): string
Gets a label that identifies this class.
Returns: string
Implementation of: IInternalStream
Inherited from: WebRtcStreamBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStreamBase.ts:206
getLocalDirection
▸ Abstract
getLocalDirection(): StreamDirection
Gets current direction indicated by the local description.
Returns: StreamDirection
Implementation of: IInternalStream
Inherited from: WebRtcStreamBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStreamBase.ts:212
getLocalReceive
▸ getLocalReceive(): boolean
Gets a value indicating whether the local peer supports receiving media on this stream.
Use this method to determine if a stream is used for sending media or only receiving media.
Returns: boolean
Implementation of: IInternalStream
Inherited from: WebRtcStreamBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStreamBase.ts:219
getLocalSend
▸ getLocalSend(): boolean
Gets a value indicating whether the local peer on this stream supports sending media on this stream.
Use this property to determine if a stream is used for sending media or only receiving media.
Returns: boolean
Implementation of: IInternalStream
Inherited from: WebRtcStreamBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStreamBase.ts:233
getMediaDescriptionId
▸ getMediaDescriptionId(): string
Gets the media description ID of this stream.
The media description ID is only available once a connection is opened with this stream, because it is obtained from the local SDP description of this stream.
Returns: string
Implementation of: IInternalStream
Inherited from: WebRtcStreamBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStreamBase.ts:247
getRemoteDirection
▸ Abstract
getRemoteDirection(): StreamDirection
Gets current direction indicated by the remote description.
Returns: StreamDirection
Implementation of: IInternalStream
Inherited from: WebRtcStreamBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStreamBase.ts:269
getRemoteReceive
▸ getRemoteReceive(): boolean
Gets a value indicating whether receiving media is supported by the remote peer on this stream. Returns false if the remote stream direction has not been received.
Returns: boolean
Implementation of: IInternalStream
Inherited from: WebRtcStreamBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStreamBase.ts:275
getRemoteSend
▸ getRemoteSend(): boolean
Gets a value indicating whether sending media is supported by the remote peer on this stream. Returns false if the remote stream direction has not been received.
Returns: boolean
Implementation of: IInternalStream
Inherited from: WebRtcStreamBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStreamBase.ts:288
getState
▸ getState(): StreamState
Gets the state of the stream.
Returns: StreamState
Implementation of: IInternalStream
Inherited from: WebRtcStreamBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStreamBase.ts:301
getTag
▸ getTag(): string
Gets optional data to associate with this instance.
Returns: string
Implementation of: IInternalStream
Inherited from: WebRtcStreamBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStreamBase.ts:321
getTransportInfo
▸ getTransportInfo(): TransportInfo
Returns: TransportInfo
Implementation of: IInternalStream
Overrides: WebRtcStreamBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStream.ts:41
getType
▸ getType(): StreamType
Gets the type.
Returns: StreamType
Implementation of: IInternalStream
Inherited from: WebRtcStreamBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStreamBase.ts:339
getTypeString
▸ getTypeString(): string
Returns: string
Overrides: WebRtcStreamBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStream.ts:4
processStateChange
▸ Protected
processStateChange(): void
Processes a state change.
Returns: void
Inherited from: WebRtcStreamBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStreamBase.ts:363
processStateLockChange
▸ Protected
processStateLockChange(): void
Processes a state lock change.
Returns: void
Inherited from: WebRtcStreamBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStreamBase.ts:374
removeOnDirectionChange
▸ removeOnDirectionChange(value
: IAction0): void
Removes a handler that is raised when the stream direction changes.
Stream direction indicates the direction of media flow. For example:
- A stream in an SFU upstream connection has a direction of SendOnly.
- A stream in an SFU downstream connection has a direction of ReceiveOnly.
- A stream in an MCU connection has a direction of SendReceive if it is attached to both local and remote media. If it is only attached to local media, it has a direction of SendOnly. If it is only attached to remote media, it has a direction of ReceiveOnly.
- An update to an SFU upstream connection might instruct the stream to stop sending audio or video frames. In this case, the direction of the stream changes to Inactive.
- An update to an SFU downstream connection might cause it to stop receiving audio or video frames. In this case, the direction of the stream changes to Inactive.
- An update to an MCU upstream connection might instruct the stream to stop sending audio or video frames. In this case, the following occurs:
- If the direction of the stream was SendOnly, then the direction changes to Inactive.
- If the direction of the stream was ReceiveOnly, then the direction changes to SendReceive.
- An update to an MCU upstream connection might instruct it to stop receiving audio or video frames. In this case, the following occurs:
- If the direction of the stream was ReceiveOnly, then the direction changes to Inactive.
- If the direction of the stream was SendReceive, then the direction changes to SendOnly.
Parameters:
Name | Type |
---|---|
value |
IAction0 |
Returns: void
Implementation of: IInternalStream
Inherited from: WebRtcStreamBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStreamBase.ts:429
removeOnStateChange
▸ removeOnStateChange(value
: IAction0): void
Removes a handler that is raised when the connection state changes.
This method can track the state of the connection and can be used to display the current status of the connection to the user, add or remove media views in the UI, and handle retry logic if the connection fails.
Parameters:
Name | Type |
---|---|
value |
IAction0 |
Returns: void
Implementation of: IInternalStream
Inherited from: WebRtcStreamBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStreamBase.ts:442
setConnection
▸ setConnection(remoteTrack
: WebRtcConnection): void
Parameters:
Name | Type |
---|---|
remoteTrack |
WebRtcConnection |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStream.ts:13
setDynamicValue
▸ setDynamicValue(key
: string, value
: Object): void
Sets a property value in the local cache.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | The property key. This key is used internally only, but should be namespaced to avoid conflict with third-party extensions. |
value |
Object | The property value. This can be any object that needs to be stored for future use. |
Returns: void
Inherited from: WebRtcStreamBase
Defined in: Generated/TypeScript/fm.liveswitch/Dynamic.ts:95
setExternalId
▸ setExternalId(value
: string): void
Sets the external identifier.
Parameters:
Name | Type |
---|---|
value |
string |
Returns: void
Implementation of: IInternalStream
Inherited from: WebRtcStreamBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStreamBase.ts:471
setLocalDirection
▸ Abstract
setLocalDirection(value
: StreamDirection): void
Sets current direction indicated by the local description.
Parameters:
Name | Type |
---|---|
value |
StreamDirection |
Returns: void
Implementation of: IInternalStream
Inherited from: WebRtcStreamBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStreamBase.ts:483
setLocalReceive
▸ setLocalReceive(value
: boolean): void
Sets a value indicating whether the local peer supports receiving media on this stream.
Use this method to determine if a stream is used for sending media or only receiving media.
Parameters:
Name | Type |
---|---|
value |
boolean |
Returns: void
Implementation of: IInternalStream
Inherited from: WebRtcStreamBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStreamBase.ts:490
setLocalSend
▸ setLocalSend(value
: boolean): void
Sets a value indicating whether the local peer on this stream supports sending media on this stream.
Use this property to determine if a stream is used for sending media or only receiving media.
Parameters:
Name | Type |
---|---|
value |
boolean |
Returns: void
Implementation of: IInternalStream
Inherited from: WebRtcStreamBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStreamBase.ts:529
setTag
▸ setTag(value
: string): void
Sets optional data to associate with this instance.
Parameters:
Name | Type |
---|---|
value |
string |
Returns: void
Implementation of: IInternalStream
Inherited from: WebRtcStreamBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStreamBase.ts:617
setTransportInfo
▸ setTransportInfo(transportInfo
: TransportInfo): void
Parameters:
Name | Type |
---|---|
transportInfo |
TransportInfo |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStream.ts:37
toString
▸ toString(): string
Returns a string that represents this instance.
Returns: string
Inherited from: WebRtcStreamBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStreamBase.ts:637
unsetDynamicValue
▸ unsetDynamicValue(key
: string): boolean
Removes a property value from the local cache. Returns true if the value was removed and returns false otherwise.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | The property key. This key is used internally only, but should be namespaced to avoid conflict with third-party extensions. |
Returns: boolean
true
if the value was removed; otherwise, false
.
Inherited from: WebRtcStreamBase
Defined in: Generated/TypeScript/fm.liveswitch/Dynamic.ts:122