/ fm / liveswitch / WebRtcStreamBase
Class: WebRtcStreamBase
fm.liveswitch.WebRtcStreamBase
Stream base properties/methods.
Hierarchy
-
↳ WebRtcStreamBase
↳↳ WebRtcStream
Implements
Table of contents
Constructors
Methods
- addOnDirectionChange
- addOnStateChange
- changeDirection
- fmliveswitchWebRtcStreamBaseInit
- getConnectedTimestamp
- 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
- setDynamicValue
- setExternalId
- setLocalDirection
- setLocalReceive
- setLocalSend
- setTag
- toString
- unsetDynamicValue
Constructors
constructor
+ new WebRtcStreamBase(type
: StreamType): WebRtcStreamBase
Initializes a new instance of the [[fm.liveswitch.streamBase]] class.
Parameters:
Name | Type | Description |
---|---|---|
type |
StreamType | The type. |
Returns: WebRtcStreamBase
Inherited from: Dynamic
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStreamBase.ts:47
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: IStream
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: IStream
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: IStream
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStreamBase.ts:107
fmliveswitchWebRtcStreamBaseInit
▸ Private
fmliveswitchWebRtcStreamBaseInit(): void
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStreamBase.ts:40
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
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStreamBase.ts:114
getConnectionId
▸ getConnectionId(): string
Gets the connection identifier.
Returns: string
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStreamBase.ts:126
getDirection
▸ Abstract
getDirection(): StreamDirection
Gets the current direction.
Returns: StreamDirection
Implementation of: IStream
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: Dynamic
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: Dynamic
Defined in: Generated/TypeScript/fm.liveswitch/Dynamic.ts:58
getExternalId
▸ getExternalId(): string
Gets the external identifier.
Returns: string
Implementation of: IStream
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStreamBase.ts:146
getId
▸ getId(): string
Gets the identifier.
Returns: string
Implementation of: IStream
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
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
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
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStreamBase.ts:194
getLabel
▸ Abstract
getLabel(): string
Gets a label that identifies this class.
Returns: string
Implementation of: IStream
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: IStream
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: IStream
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: IStream
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: IStream
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: IStream
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: IStream
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: IStream
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStreamBase.ts:288
getState
▸ getState(): StreamState
Gets the state of the stream.
Returns: StreamState
Implementation of: IStream
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStreamBase.ts:301
getTag
▸ getTag(): string
Gets optional data to associate with this instance.
Returns: string
Implementation of: IStream
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStreamBase.ts:321
getTransportInfo
▸ Abstract
getTransportInfo(): TransportInfo
Gets the stream transport info.
Returns: TransportInfo
Implementation of: IStream
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStreamBase.ts:333
getType
▸ getType(): StreamType
Gets the type.
Returns: StreamType
Implementation of: IStream
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStreamBase.ts:339
getTypeString
▸ getTypeString(): string
Returns: string
Overrides: Dynamic
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStreamBase.ts:10
processStateChange
▸ Protected
processStateChange(): void
Processes a state change.
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStreamBase.ts:363
processStateLockChange
▸ Protected
processStateLockChange(): void
Processes a state lock change.
Returns: void
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: IStream
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: IStream
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStreamBase.ts:442
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: Dynamic
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: IStream
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: IStream
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: IStream
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: IStream
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: IStream
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcStreamBase.ts:617
toString
▸ toString(): string
Returns a string that represents this instance.
Returns: string
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: Dynamic
Defined in: Generated/TypeScript/fm.liveswitch/Dynamic.ts:122