Search Results for

    / fm / liveswitch / DataStream

    Class: DataStream

    fm.liveswitch.DataStream

    Hierarchy

    • Stream

      ↳ DataStream

    Implements

    • IDataStream<DataChannel>
    • IExternalDataStream

    Table of contents

    Constructors

    • constructor

    Methods

    • addChannel
    • addOnChannel
    • addOnDirectionChange
    • addOnInternalChannel
    • addOnStateChange
    • changeDirection
    • externalToInternal
    • externalsToInternals
    • getAllChannels
    • getChannels
    • getDirection
    • getDynamicProperties
    • getDynamicValue
    • getEncryptionPolicy
    • getExternalId
    • getId
    • getInfo
    • getLabel
    • getLocalDirection
    • getLocalReceive
    • getLocalSend
    • getMediaDescriptionId
    • getRemoteDirection
    • getRemoteReceive
    • getRemoteSend
    • getState
    • getTag
    • getTransportInfo
    • getType
    • getTypeString
    • internalToExternal
    • internalsToExternals
    • removeOnChannel
    • removeOnDirectionChange
    • removeOnInternalChannel
    • removeOnStateChange
    • setDynamicValue
    • setExternalId
    • setGetRemoteConnectionInfo
    • setLocalDirection
    • setLocalReceive
    • setLocalSend
    • setRemoteDirection
    • setTag
    • unsetDynamicValue

    Constructors

    constructor

    + new DataStream(channel: DataChannel): DataStream

    Parameters:

    Name Type
    channel DataChannel

    Returns: DataStream

    Inherited from: Stream

    Defined in: Generated/TypeScript/fm.liveswitch/DataStream.ts:22

    + new DataStream(channels: DataChannel[]): DataStream

    Parameters:

    Name Type
    channels DataChannel[]

    Returns: DataStream

    Defined in: Generated/TypeScript/fm.liveswitch/DataStream.ts:24

    + new DataStream(): DataStream

    Returns: DataStream

    Defined in: Generated/TypeScript/fm.liveswitch/DataStream.ts:25

    Methods

    addChannel

    ▸ addChannel(channel: DataChannel): void

    Parameters:

    Name Type
    channel DataChannel

    Returns: void

    Defined in: Generated/TypeScript/fm.liveswitch/DataStream.ts:94


    addOnChannel

    ▸ addOnChannel(value: IAction1<DataChannel>): void

    Parameters:

    Name Type
    value IAction1<DataChannel>

    Returns: void

    Defined in: Generated/TypeScript/fm.liveswitch/DataStream.ts:108


    addOnDirectionChange

    ▸ addOnDirectionChange(value: IAction0): void

    Registers a handler to be called 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.
      The direction of a stream can change over its lifecycle. For example:
    • 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 will change 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 will change 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.
        An event handler bound to the change in direction can be used to update the UI accordingly so the user is aware of the change in the state of the application.

    Parameters:

    Name Type
    value IAction0

    Returns: void

    Implementation of: IExternalDataStream

    Inherited from: Stream

    Defined in: Generated/TypeScript/fm.liveswitch/Stream.ts:159


    addOnInternalChannel

    ▸ addOnInternalChannel(value: IAction1<DataChannel>): void

    Parameters:

    Name Type
    value IAction1<DataChannel>

    Returns: void

    Defined in: Generated/TypeScript/fm.liveswitch/DataStream.ts:116


    addOnStateChange

    ▸ addOnStateChange(value: IAction0): void

    Registers a handler to be called once 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.
    The connection object passes to the handler which allows access to the current connection state through the connection.getState() method. This returns a ConnectionState enum.
    Possible connection states are the following:

    • New: The connection object has been created, but open has not yet been called.
    • Initializing: The connection is initializing, but no connection attempts have been made.
    • Connecting: The connection is being established.
    • Connected: The connection has been successfully established.
    • Failing: The connection has encountered an error and is cleaning up.
    • Failed: The connection encountered an error and has cleaned up.
    • Closing: The connection has been instructed to close and is cleaning up.
    • Closed: The connection has been instructed to close and has cleaned up.

    Parameters:

    Name Type
    value IAction0

    Returns: void

    Implementation of: IExternalDataStream

    Inherited from: Stream

    Defined in: Generated/TypeScript/fm.liveswitch/Stream.ts:29


    changeDirection

    ▸ changeDirection(newDirection: StreamDirection): Error

    Parameters:

    Name Type
    newDirection StreamDirection

    Returns: Error

    Implementation of: IExternalDataStream

    Inherited from: Stream

    Defined in: Generated/TypeScript/fm.liveswitch/Stream.ts:37


    externalToInternal

    ▸ PrivateexternalToInternal(external: IExternalDataChannel): IInternalDataChannel

    Parameters:

    Name Type
    external IExternalDataChannel

    Returns: IInternalDataChannel

    Defined in: Generated/TypeScript/fm.liveswitch/DataStream.ts:74


    externalsToInternals

    ▸ PrivateexternalsToInternals(externals: IExternalDataChannel[]): IInternalDataChannel[]

    Parameters:

    Name Type
    externals IExternalDataChannel[]

    Returns: IInternalDataChannel[]

    Defined in: Generated/TypeScript/fm.liveswitch/DataStream.ts:78


    getAllChannels

    ▸ getAllChannels(): DataChannel[]

    Returns: DataChannel[]

    Defined in: Generated/TypeScript/fm.liveswitch/DataStream.ts:66


    getChannels

    ▸ getChannels(): DataChannel[]

    Returns: DataChannel[]

    Implementation of: IExternalDataStream

    Defined in: Generated/TypeScript/fm.liveswitch/DataStream.ts:70


    getDirection

    ▸ getDirection(): StreamDirection

    Gets the Media Direction of a stream as a StreamDirection enumerator. The following stream direction values are defined:

    • SendReceive: A stream that can send and can receive.
    • SendOnly: A stream that can send.
    • ReceiveOnly: A stream that can receive.
    • Inactive: A stream that cannot send or receive.
    • Unset: A stream direction has not been set.

    Returns: StreamDirection

    The Media Direction as a StreamDirection enumerator.

    Implementation of: IExternalDataStream

    Inherited from: Stream

    Defined in: Generated/TypeScript/fm.liveswitch/Stream.ts:54


    getDynamicProperties

    ▸ getDynamicProperties(): Hash<string, Object>

    Gets all dynamic properties on this instance.

    Returns: Hash<string, Object>

    Inherited from: Stream

    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: Stream

    Defined in: Generated/TypeScript/fm.liveswitch/Dynamic.ts:58


    getEncryptionPolicy

    ▸ getEncryptionPolicy(): EncryptionPolicy

    Returns: EncryptionPolicy

    Inherited from: Stream

    Defined in: Generated/TypeScript/fm.liveswitch/Stream.ts:41


    getExternalId

    ▸ getExternalId(): string

    Returns: string

    Implementation of: IExternalDataStream

    Inherited from: Stream

    Defined in: Generated/TypeScript/fm.liveswitch/Stream.ts:98


    getId

    ▸ getId(): string

    Returns: string

    Implementation of: IExternalDataStream

    Inherited from: Stream

    Defined in: Generated/TypeScript/fm.liveswitch/Stream.ts:94


    getInfo

    ▸ getInfo(): DataStreamInfo

    Returns: DataStreamInfo

    Implementation of: IExternalDataStream

    Defined in: Generated/TypeScript/fm.liveswitch/DataStream.ts:15


    getLabel

    ▸ getLabel(): string

    Returns: string

    Implementation of: IExternalDataStream

    Inherited from: Stream

    Defined in: Generated/TypeScript/fm.liveswitch/Stream.ts:102


    getLocalDirection

    ▸ getLocalDirection(): StreamDirection

    Returns: StreamDirection

    Implementation of: IExternalDataStream

    Inherited from: Stream

    Defined in: Generated/TypeScript/fm.liveswitch/Stream.ts:106


    getLocalReceive

    ▸ getLocalReceive(): boolean

    Checks whether the local peer supports receiving media on this stream. Returns true if the local peer supports receiving media on this stream and false otherwise.
    Use this method to determine if a stream is used for receiving media.

    Returns: boolean

    Implementation of: IExternalDataStream

    Inherited from: Stream

    Defined in: Generated/TypeScript/fm.liveswitch/Stream.ts:62


    getLocalSend

    ▸ getLocalSend(): boolean

    Checks whether the local peer on this stream supports sending media on this stream. Returns true if the local peer supports sending media and false otherwise.
    Use this method to determine if a stream is used for sending media or only receiving media.

    Returns: boolean

    Implementation of: IExternalDataStream

    Inherited from: Stream

    Defined in: Generated/TypeScript/fm.liveswitch/Stream.ts:74


    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: IExternalDataStream

    Inherited from: Stream

    Defined in: Generated/TypeScript/fm.liveswitch/Stream.ts:114


    getRemoteDirection

    ▸ getRemoteDirection(): StreamDirection

    Returns: StreamDirection

    Implementation of: IExternalDataStream

    Inherited from: Stream

    Defined in: Generated/TypeScript/fm.liveswitch/Stream.ts:90


    getRemoteReceive

    ▸ getRemoteReceive(): boolean

    Returns: boolean

    Implementation of: IExternalDataStream

    Inherited from: Stream

    Defined in: Generated/TypeScript/fm.liveswitch/Stream.ts:82


    getRemoteSend

    ▸ getRemoteSend(): boolean

    Returns: boolean

    Implementation of: IExternalDataStream

    Inherited from: Stream

    Defined in: Generated/TypeScript/fm.liveswitch/Stream.ts:86


    getState

    ▸ getState(): StreamState

    Returns: StreamState

    Implementation of: IExternalDataStream

    Inherited from: Stream

    Defined in: Generated/TypeScript/fm.liveswitch/Stream.ts:11


    getTag

    ▸ getTag(): string

    Returns: string

    Implementation of: IExternalDataStream

    Inherited from: Stream

    Defined in: Generated/TypeScript/fm.liveswitch/Stream.ts:118


    getTransportInfo

    ▸ getTransportInfo(): TransportInfo

    Returns: TransportInfo

    Implementation of: IExternalDataStream

    Inherited from: Stream

    Defined in: Generated/TypeScript/fm.liveswitch/Stream.ts:183


    getType

    ▸ getType(): StreamType

    Returns: StreamType

    Implementation of: IExternalDataStream

    Inherited from: Stream

    Defined in: Generated/TypeScript/fm.liveswitch/Stream.ts:122


    getTypeString

    ▸ getTypeString(): string

    Returns: string

    Overrides: Stream

    Defined in: Generated/TypeScript/fm.liveswitch/DataStream.ts:4


    internalToExternal

    ▸ PrivateinternalToExternal(internal: IInternalDataChannel): IExternalDataChannel

    Parameters:

    Name Type
    internal IInternalDataChannel

    Returns: IExternalDataChannel

    Defined in: Generated/TypeScript/fm.liveswitch/DataStream.ts:84


    internalsToExternals

    ▸ PrivateinternalsToExternals(internals: IInternalDataChannel[]): IExternalDataChannel[]

    Parameters:

    Name Type
    internals IInternalDataChannel[]

    Returns: IExternalDataChannel[]

    Defined in: Generated/TypeScript/fm.liveswitch/DataStream.ts:88


    removeOnChannel

    ▸ removeOnChannel(value: IAction1<DataChannel>): void

    Parameters:

    Name Type
    value IAction1<DataChannel>

    Returns: void

    Defined in: Generated/TypeScript/fm.liveswitch/DataStream.ts:112


    removeOnDirectionChange

    ▸ removeOnDirectionChange(value: IAction0): void

    Removes a handler to be called 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.
      The direction of a stream can change over its lifecycle. For example:
    • 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 will change 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 will change 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: IExternalDataStream

    Inherited from: Stream

    Defined in: Generated/TypeScript/fm.liveswitch/Stream.ts:179


    removeOnInternalChannel

    ▸ removeOnInternalChannel(value: IAction1<DataChannel>): void

    Parameters:

    Name Type
    value IAction1<DataChannel>

    Returns: void

    Defined in: Generated/TypeScript/fm.liveswitch/DataStream.ts:120


    removeOnStateChange

    ▸ removeOnStateChange(value: IAction0): void

    Parameters:

    Name Type
    value IAction0

    Returns: void

    Implementation of: IExternalDataStream

    Inherited from: Stream

    Defined in: Generated/TypeScript/fm.liveswitch/Stream.ts:33


    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: Stream

    Defined in: Generated/TypeScript/fm.liveswitch/Dynamic.ts:95


    setExternalId

    ▸ setExternalId(value: string): void

    Parameters:

    Name Type
    value string

    Returns: void

    Implementation of: IExternalDataStream

    Inherited from: Stream

    Defined in: Generated/TypeScript/fm.liveswitch/Stream.ts:126


    setGetRemoteConnectionInfo

    ▸ setGetRemoteConnectionInfo(value: IFunction1<string, any>): void

    Parameters:

    Name Type
    value IFunction1<string, any>

    Returns: void

    Defined in: Generated/TypeScript/fm.liveswitch/DataStream.ts:54


    setLocalDirection

    ▸ setLocalDirection(value: StreamDirection): void

    Parameters:

    Name Type
    value StreamDirection

    Returns: void

    Implementation of: IExternalDataStream

    Inherited from: Stream

    Defined in: Generated/TypeScript/fm.liveswitch/Stream.ts:130


    setLocalReceive

    ▸ setLocalReceive(receiveEnabled: boolean): void

    Parameters:

    Name Type
    receiveEnabled boolean

    Returns: void

    Implementation of: IExternalDataStream

    Inherited from: Stream

    Defined in: Generated/TypeScript/fm.liveswitch/Stream.ts:66


    setLocalSend

    ▸ setLocalSend(sendEnabled: boolean): void

    Parameters:

    Name Type
    sendEnabled boolean

    Returns: void

    Implementation of: IExternalDataStream

    Inherited from: Stream

    Defined in: Generated/TypeScript/fm.liveswitch/Stream.ts:78


    setRemoteDirection

    ▸ setRemoteDirection(value: StreamDirection): void

    Parameters:

    Name Type
    value StreamDirection

    Returns: void

    Inherited from: Stream

    Defined in: Generated/TypeScript/fm.liveswitch/Stream.ts:134


    setTag

    ▸ setTag(value: string): void

    Parameters:

    Name Type
    value string

    Returns: void

    Implementation of: IExternalDataStream

    Inherited from: Stream

    Defined in: Generated/TypeScript/fm.liveswitch/Stream.ts:138


    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: Stream

    Defined in: Generated/TypeScript/fm.liveswitch/Dynamic.ts:122

    In This Article
    Back to top Copyright © LiveSwitch Inc. All Rights Reserved. Doc build for LiveSwitch v1.19.2