Search Results for

    / fm / liveswitch / LocalMedia

    Class: LocalMedia

    fm.liveswitch.LocalMedia

    Hierarchy

    • Media

      ↳ LocalMedia

    Implements

    • ILocalMedia<LocalMedia, AudioTrack, VideoTrack>
    • IExternalLocalMedia

    Table of contents

    Constructors

    • constructor

    Properties

    • _internal

    Methods

    • addOnAudioDestroyed
    • addOnAudioLevel
    • addOnAudioMuted
    • addOnAudioStarted
    • addOnAudioStopped
    • addOnAudioUnmuted
    • addOnVideoDestroyed
    • addOnVideoMuted
    • addOnVideoSize
    • addOnVideoSizeChange
    • addOnVideoStarted
    • addOnVideoStopped
    • addOnVideoUnmuted
    • changeAudioInput
    • changeAudioSourceInput
    • changeVideoInput
    • changeVideoSourceInput
    • destroy
    • getAudioEncoding
    • getAudioEncodings
    • getAudioGain
    • getAudioInput
    • getAudioInputs
    • getAudioLevelInterval
    • getAudioMuted
    • getAudioSimulcastDisabled
    • getAudioSimulcastEncodingCount
    • getAudioSimulcastPreferredBitrate
    • getAudioSink
    • getAudioSourceInput
    • getAudioSourceInputs
    • getAudioTrack
    • getAudioTracks
    • getAudioVolume
    • getDynamicProperties
    • getDynamicValue
    • getId
    • getState
    • getTypeString
    • getVideoEncoding
    • getVideoEncodings
    • getVideoInput
    • getVideoInputs
    • getVideoMuted
    • getVideoSimulcastBitsPerPixel
    • getVideoSimulcastDegradationPreference
    • getVideoSimulcastDisabled
    • getVideoSimulcastEncodingCount
    • getVideoSimulcastPreferredBitrate
    • getVideoSink
    • getVideoSize
    • getVideoSourceInput
    • getVideoSourceInputs
    • getVideoTrack
    • getVideoTracks
    • getView
    • getViewSink
    • grabVideoFrame
    • removeOnAudioDestroyed
    • removeOnAudioLevel
    • removeOnAudioMuted
    • removeOnAudioStarted
    • removeOnAudioStopped
    • removeOnAudioUnmuted
    • removeOnVideoDestroyed
    • removeOnVideoMuted
    • removeOnVideoSize
    • removeOnVideoSizeChange
    • removeOnVideoStarted
    • removeOnVideoStopped
    • removeOnVideoUnmuted
    • setAudioEncodings
    • setAudioGain
    • setAudioInput
    • setAudioLevelInterval
    • setAudioMuted
    • setAudioSimulcastDisabled
    • setAudioSimulcastEncodingCount
    • setAudioSimulcastPreferredBitrate
    • setAudioSourceInput
    • setAudioVolume
    • setDynamicValue
    • setId
    • setVideoEncodings
    • setVideoInput
    • setVideoMuted
    • setVideoSimulcastBitsPerPixel
    • setVideoSimulcastDegradationPreference
    • setVideoSimulcastDisabled
    • setVideoSimulcastEncodingCount
    • setVideoSimulcastPreferredBitrate
    • setVideoSourceInput
    • start
    • stop
    • unsetDynamicValue
    • canScreenShare
    • getChromeExtensionId
    • getChromeExtensionInstalled
    • getChromeExtensionRequiresUserGesture
    • getChromeExtensionUrl
    • setChromeExtensionId
    • setChromeExtensionRequiresUserGesture

    Constructors

    constructor

    + new LocalMedia(audio: any, video: any, screen?: boolean): LocalMedia

    Parameters:

    Name Type
    audio any
    video any
    screen? boolean

    Returns: LocalMedia

    Inherited from: Media

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:211

    Properties

    _internal

    • Private _internal: IInternalLocalMedia

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:12

    Methods

    addOnAudioDestroyed

    ▸ addOnAudioDestroyed(value: IAction0): void

    Registers a handler that triggers when the audio track is destroyed.

    Parameters:

    Name Type
    value IAction0

    Returns: void

    Implementation of: IExternalLocalMedia

    Inherited from: Media

    Defined in: Generated/TypeScript/fm.liveswitch/Media.ts:14


    addOnAudioLevel

    ▸ addOnAudioLevel(value: IAction1<number>): void

    Registers a handler that gives audio level updates for the media. This method can be called before or after the media has started. When the media is in the Started state, the function runs every 100 milliseconds.
    Use this method to determine which audio streams are active.

    Parameters:

    Name Type
    value IAction1<number>

    Returns: void

    Implementation of: IExternalLocalMedia

    Inherited from: Media

    Defined in: Generated/TypeScript/fm.liveswitch/Media.ts:43


    addOnAudioMuted

    ▸ addOnAudioMuted(value: IAction0): void

    Parameters:

    Name Type
    value IAction0

    Returns: void

    Implementation of: IExternalLocalMedia

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:18


    addOnAudioStarted

    ▸ addOnAudioStarted(value: IAction0): void

    Registers a handler on this media that’s raised when the audio track is started.
    If there are multiple audio tracks in a custom media stack, this method calls into the first audio track.

    Parameters:

    Name Type
    value IAction0

    Returns: void

    Implementation of: IExternalLocalMedia

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:47


    addOnAudioStopped

    ▸ addOnAudioStopped(value: IAction0): void

    Registers a handler on this media that’s raised when the audio track is stopped.
    If there are multiple audio tracks in a custom media stack, this method calls into the first audio track.

    Parameters:

    Name Type
    value IAction0

    Returns: void

    Implementation of: IExternalLocalMedia

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:55


    addOnAudioUnmuted

    ▸ addOnAudioUnmuted(value: IAction0): void

    Parameters:

    Name Type
    value IAction0

    Returns: void

    Implementation of: IExternalLocalMedia

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:21


    addOnVideoDestroyed

    ▸ addOnVideoDestroyed(value: IAction0): void

    Registers a handler that triggers when the video track is destroyed.

    Parameters:

    Name Type
    value IAction0

    Returns: void

    Implementation of: IExternalLocalMedia

    Inherited from: Media

    Defined in: Generated/TypeScript/fm.liveswitch/Media.ts:21


    addOnVideoMuted

    ▸ addOnVideoMuted(value: IAction0): void

    Parameters:

    Name Type
    value IAction0

    Returns: void

    Implementation of: IExternalLocalMedia

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


    addOnVideoSize

    ▸ addOnVideoSize(value: IAction1<Size>): void

    Registers a handler that provides updates about the media’s video size.
    This event can be used to determine when the video size changes.

    Parameters:

    Name Type
    value IAction1<Size>

    Returns: void

    Implementation of: IExternalLocalMedia

    Inherited from: Media

    Defined in: Generated/TypeScript/fm.liveswitch/Media.ts:51


    addOnVideoSizeChange

    ▸ addOnVideoSizeChange(value: IAction1<Size>): void

    Parameters:

    Name Type
    value IAction1<Size>

    Returns: void

    Implementation of: IExternalLocalMedia

    Inherited from: Media

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


    addOnVideoStarted

    ▸ addOnVideoStarted(value: IAction0): void

    Registers a handler on this media that’s raised when the video track is started.
    If there are multiple video tracks in a custom media stack, this method calls into the first video track.

    Parameters:

    Name Type
    value IAction0

    Returns: void

    Implementation of: IExternalLocalMedia

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:63


    addOnVideoStopped

    ▸ addOnVideoStopped(value: IAction0): void

    Registers a handler on this media that’s raised when the video track is stopped.
    If there are multiple video tracks in a custom media stack, this method calls into the first video track.

    Parameters:

    Name Type
    value IAction0

    Returns: void

    Implementation of: IExternalLocalMedia

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:71


    addOnVideoUnmuted

    ▸ addOnVideoUnmuted(value: IAction0): void

    Parameters:

    Name Type
    value IAction0

    Returns: void

    Implementation of: IExternalLocalMedia

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:27


    changeAudioInput

    ▸ changeAudioInput(audioInput: SourceInput): Future<Object>

    deprecated Use changeAudioSourceInput instead.

    Parameters:

    Name Type
    audioInput SourceInput

    Returns: Future<Object>

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:343


    changeAudioSourceInput

    ▸ changeAudioSourceInput(audioSourceInput: SourceInput): Future<Object>

    Changes the audio source input of the audio track while the media is active. If there are multiple audio tracks in a custom media stack, this method calls into the first audio track.

    Parameters:

    Name Type
    audioSourceInput SourceInput

    Returns: Future<Object>

    Implementation of: IExternalLocalMedia

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:242


    changeVideoInput

    ▸ changeVideoInput(videoInput: SourceInput): Future<Object>

    deprecated Use changeVideoSourceInput instead.

    Parameters:

    Name Type
    videoInput SourceInput

    Returns: Future<Object>

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:350


    changeVideoSourceInput

    ▸ changeVideoSourceInput(videoSourceInput: SourceInput): Future<Object>

    Changes the video source input of the video track while the media is active. If there are multiple video tracks in a custom media stack, this method calls into the first video track.
    This method can be used to change the video source’s input on a mobile device from a front to a back camera.

    Parameters:

    Name Type
    videoSourceInput SourceInput

    Returns: Future<Object>

    Implementation of: IExternalLocalMedia

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:250


    destroy

    ▸ destroy(): void

    Destroys all non-persistent internal objects encapsulated by the Media class.
    This method iterates over all audio and video tracks and calls each track's Destroy method for non-persistent tracks.

    Returns: void

    Implementation of: IExternalLocalMedia

    Inherited from: Media

    Defined in: Generated/TypeScript/fm.liveswitch/Media.ts:217


    getAudioEncoding

    ▸ getAudioEncoding(): AudioEncodingConfig

    Gets the local audio encoding configuration. If there are multiple audio encoding configurations, this method returns the first audio encoding configuration.

    Returns: AudioEncodingConfig

    Implementation of: IExternalLocalMedia

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:110


    getAudioEncodings

    ▸ getAudioEncodings(): AudioEncodingConfig[]

    Gets the local audio encoding configurations.

    Returns: AudioEncodingConfig[]

    Implementation of: IExternalLocalMedia

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:117


    getAudioGain

    ▸ getAudioGain(): number

    Gets a value indicating the gain (input amplification) of this audio track.

    Returns: number

    Implementation of: IExternalLocalMedia

    Inherited from: Media

    Defined in: Generated/TypeScript/fm.liveswitch/Media.ts:61


    getAudioInput

    ▸ getAudioInput(): SourceInput

    deprecated Use getAudioSourceInput instead.

    Returns: SourceInput

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:357


    getAudioInputs

    ▸ getAudioInputs(): Future<SourceInput[]>

    deprecated Use getAudioSourceInputs instead.

    Returns: Future<SourceInput[]>

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:364


    getAudioLevelInterval

    ▸ getAudioLevelInterval(): number

    Gets the interval in milliseconds between audio level events.

    Returns: number

    Implementation of: IExternalLocalMedia

    Inherited from: Media

    Defined in: Generated/TypeScript/fm.liveswitch/Media.ts:68


    getAudioMuted

    ▸ getAudioMuted(): boolean

    Checks whether the audio track is muted. Returns true if the audio track is muted and false otherwise. If there are multiple audio tracks in a custom media stack, this method calls into the first audio track.

    Returns: boolean

    Implementation of: IExternalLocalMedia

    Inherited from: Media

    Defined in: Generated/TypeScript/fm.liveswitch/Media.ts:75


    getAudioSimulcastDisabled

    ▸ getAudioSimulcastDisabled(): boolean

    Checks whether audio simulcast is disabled. Returns true if audio simulcast is disabled and returns false otherwise.

    Returns: boolean

    Implementation of: IExternalLocalMedia

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:406


    getAudioSimulcastEncodingCount

    ▸ getAudioSimulcastEncodingCount(): number

    Gets the number of audio simulcast encodings. The number of encodings cannot be changed once they are set.

    Returns: number

    Implementation of: IExternalLocalMedia

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:420


    getAudioSimulcastPreferredBitrate

    ▸ getAudioSimulcastPreferredBitrate(): number

    Gets the preferred bitrate for audio simulcast in Kbps.

    Returns: number

    Implementation of: IExternalLocalMedia

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:436


    getAudioSink

    ▸ getAudioSink(): DomAudioSink

    Gets the audio sink. An audio sink is where audio leaves the processing pipeline.
    An example of an audio sink is a playback device like a speaker.

    Returns: DomAudioSink

    Implementation of: IExternalLocalMedia

    Inherited from: Media

    Defined in: Generated/TypeScript/fm.liveswitch/Media.ts:225


    getAudioSourceInput

    ▸ getAudioSourceInput(): SourceInput

    Gets the name and ID of the currently available audio device. If there are multiple audio tracks in a custom media stack, this method calls into the first audio track.
    A common requirement when working with LiveSwitch is to present the available media device for the user to select from. Additionally, you might want to store the selected device for retrieval. For example, to select the device again if the user leaves and returns.
    A device's ID does not have to be guaranteed to be the same between browser sessions. Ensure your code that changes audio inputs reverts to a default if the selected device is unavailable. To do this, pass nothing to the method.
    If you have not been granted access to the underlying media, some browsers anonymize the returned data to prevent browser fingerprinting. It is highly recommended that you use this method once you have gained access to the underlying media by prompting the user using localMedia.start()

    Returns: SourceInput

    Implementation of: IExternalLocalMedia

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:260


    getAudioSourceInputs

    ▸ getAudioSourceInputs(): Future<SourceInput[]>

    Gets a list of the names and IDs of currently available audio devices.
    A common requirement when working with LiveSwitch is to present a list of available media devices for the user to select from. Additionally, you might want to store the selected devices for retrieval. For example, to select the device again if the user leaves and returns.
    A device's ID does not have to be guaranteed to be the same between browser sessions. This list can change when devices are added or removed. Ensure your code that changes audio inputs reverts to a default if the selected device is unavailable. To do this, pass nothing to the method.
    If you have not been granted access to the underlying media, some browsers anonymize the returned data to prevent browser fingerprinting. It is highly recommended that you use this method once you have gained access to the underlying media by prompting the user using localMedia.start().

    Returns: Future<SourceInput[]>

    Implementation of: IExternalLocalMedia

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:270


    getAudioTrack

    ▸ getAudioTrack(): AudioTrack

    Gets the audio track from this media. If there are multiple audio tracks in a custom media stack, this method calls into the first audio track. Returns null if there are no audio tracks.

    Returns: AudioTrack

    Implementation of: IExternalLocalMedia

    Inherited from: Media

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


    getAudioTracks

    ▸ getAudioTracks(): AudioTrack[]

    Gets all audio tracks from this media.

    Returns: AudioTrack[]

    Implementation of: IExternalLocalMedia

    Inherited from: Media

    Defined in: Generated/TypeScript/fm.liveswitch/Media.ts:89


    getAudioVolume

    ▸ getAudioVolume(): number

    Gets a value that indicates the volume (output resistance) of the audio track.
    Valid values range between 0.0 and 1.0. A value of 1.0 indicates that there is no output resistance and audio is played at the input level. A value of 0.0 mutes the audio.
    If there are multiple audio tracks in a custom media stack, this method calls into the first audio track.

    Returns: number

    Implementation of: IExternalLocalMedia

    Inherited from: Media

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


    getDynamicProperties

    ▸ getDynamicProperties(): Hash<string, Object>

    Gets all dynamic properties on this instance.

    Returns: Hash<string, Object>

    Inherited from: Media

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

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


    getId

    ▸ getId(): string

    Gets the unique media identifier.

    Returns: string

    Implementation of: IExternalLocalMedia

    Inherited from: Media

    Defined in: Generated/TypeScript/fm.liveswitch/Media.ts:105


    getState

    ▸ getState(): LocalMediaState

    Gets the current state of this media. The possible states are defined in the enumeration LocalMediaState. Use this method to check if, for example, the media instance is starting, has started, is stopping, or has stopped.

    Returns: LocalMediaState

    Implementation of: IExternalLocalMedia

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:399


    getTypeString

    ▸ getTypeString(): string

    Gets the LocalMedia object type as a string.

    Returns: string

    Overrides: Media

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:8


    getVideoEncoding

    ▸ getVideoEncoding(): VideoEncodingConfig

    Gets the local video encoding configuration.
    If there are multiple video tracks in a custom media stack, this method calls into the first video track. Returns the local VideoEncodingConfig.

    Returns: VideoEncodingConfig

    Implementation of: IExternalLocalMedia

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:133


    getVideoEncodings

    ▸ getVideoEncodings(): VideoEncodingConfig[]

    Gets local video encoding configurations. Returns the array of local VideoEncodingConfig.

    Returns: VideoEncodingConfig[]

    Implementation of: IExternalLocalMedia

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:140


    getVideoInput

    ▸ getVideoInput(): SourceInput

    deprecated Use getVideoSourceInput instead.

    Returns: SourceInput

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:371


    getVideoInputs

    ▸ getVideoInputs(): Future<SourceInput[]>

    deprecated Use getVideoSourceInputs instead.

    Returns: Future<SourceInput[]>

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:378


    getVideoMuted

    ▸ getVideoMuted(): boolean

    Checks whether the video track is muted. Returns true if the video track is muted and false otherwise.
    If the muted video track is part of a local media stack, then all outbound video frames are muted for any participants receiving them. If the muted video track is part of a remote media stack, then inbound video frames are muted and other participants are not affected.
    If there are multiple video tracks in a custom media stack, this method calls into the first video track.

    Returns: boolean

    Implementation of: IExternalLocalMedia

    Inherited from: Media

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


    getVideoSimulcastBitsPerPixel

    ▸ getVideoSimulcastBitsPerPixel(): number

    Gets the number of bits per pixel (bpp) for a video simulcast.

    Returns: number

    Implementation of: IExternalLocalMedia

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:492


    getVideoSimulcastDegradationPreference

    ▸ getVideoSimulcastDegradationPreference(): VideoDegradationPreference

    Gets the video’s simulcast degradation preference.
    The following degradation preferences can be set:
    Automatic: Prefers to automate degradation based on video type. A Screen video type prefers to degrade FrameRate. A Camera video type prefers to degrade Resolution. An unknown video type prefers a Balanced approach.
    Balanced: Prefers to degrade both FrameRate and Resolution together in smaller increments.
    FrameRate: Prefers to degrade FrameRate instead of Resolution.
    Resolution: Prefers to degrade Resolution instead of FrameRate.

    Returns: VideoDegradationPreference

    Implementation of: IExternalLocalMedia

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:512


    getVideoSimulcastDisabled

    ▸ getVideoSimulcastDisabled(): boolean

    Checks whether video simulcast is disabled. Returns true if video simulcast is disabled and returns false otherwise.

    Returns: boolean

    Implementation of: IExternalLocalMedia

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:450


    getVideoSimulcastEncodingCount

    ▸ getVideoSimulcastEncodingCount(): number

    Gets the number of video simulcast encodings.

    Returns: number

    Implementation of: IExternalLocalMedia

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:464


    getVideoSimulcastPreferredBitrate

    ▸ getVideoSimulcastPreferredBitrate(): number

    Gets the preferred bitrate of an video simulcast in Kbps.

    Returns: number

    Implementation of: IExternalLocalMedia

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:478


    getVideoSink

    ▸ getVideoSink(): DomVideoSink

    Gets the video view sink if video is not disabled. ViewSink controls the view which displays the video.
    For example, in HTML the element is the view managed by the view sink. Call this method if you want to transform the view, like, for instance, adjusting its resolution or frame rates.

    Returns: DomVideoSink

    Implementation of: IExternalLocalMedia

    Inherited from: Media

    Defined in: Generated/TypeScript/fm.liveswitch/Media.ts:237


    getVideoSize

    ▸ getVideoSize(): Size

    Gets the video track’s resolution.
    If there are multiple video tracks in a custom media stack, this method calls into the first video track.
    If you need to adjust a UI’s layout, use this method to check video dimensions. You can also use addOnVideoSize to ensure that the code is responsive.

    Returns: Size

    Implementation of: IExternalLocalMedia

    Inherited from: Media

    Defined in: Generated/TypeScript/fm.liveswitch/Media.ts:123


    getVideoSourceInput

    ▸ getVideoSourceInput(): SourceInput

    Gets the name and ID of the currently available video device. If there are multiple video tracks in a custom media stack, this method calls into the first video track.
    A common requirement when working with LiveSwitch is to present the available media device for the user to select from. Additionally, you might want to store the selected device for retrieval. For example, to select the device again if the user leaves and returns.
    A device's ID does not have to be guaranteed to be the same between browser sessions. Ensure your code that changes video inputs reverts to a default if the selected device is unavailable. To do this, pass nothing to the method.
    If you have not been granted access to the underlying media, some browsers anonymize the returned data to prevent browser fingerprinting. It is highly recommended that you use this method once you have gained access to the underlying media by prompting the user using localMedia.start().

    Returns: SourceInput

    Implementation of: IExternalLocalMedia

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:280


    getVideoSourceInputs

    ▸ getVideoSourceInputs(): Future<SourceInput[]>

    Gets a list of the names and IDs of currently available video devices.
    A common requirement when working with LiveSwitch is to present a list of available media devices for the user to select from. Additionally, you might want to store the selected devices for retrieval. For example, to select the device again if the user leaves and returns.
    A device's ID does not have to be guaranteed to be the same between browser sessions. This list can change when devices are added or removed. Ensure your code that changes video inputs falls back to a default if the selected device is unavailable. To do this, pass nothing to the method.
    If you have not been granted access to the underlying media, some browsers anonymize the returned data to prevent browser fingerprinting. It is highly recommended that you use this method once you have gained access to the underlying media by prompting the user using localMedia.start().

    Returns: Future<SourceInput[]>

    Implementation of: IExternalLocalMedia

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:290


    getVideoTrack

    ▸ getVideoTrack(): VideoTrack

    Gets the video track from this media.
    If there are multiple video tracks in a custom media stack, this method calls into the first video track. Returns null if there are no video tracks.

    Returns: VideoTrack

    Implementation of: IExternalLocalMedia

    Inherited from: Media

    Defined in: Generated/TypeScript/fm.liveswitch/Media.ts:131


    getVideoTracks

    ▸ getVideoTracks(): VideoTrack[]

    Gets all video tracks from this media.

    Returns: VideoTrack[]

    Implementation of: IExternalLocalMedia

    Inherited from: Media

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


    getView

    ▸ getView(): HTMLElement

    Gets the view container from the media. On the web, the view is returned as a div element that contains an HTML5 video element. As an alternative to the layout manager, you can place this video element anywhere you want on the page.
    Call this method if you want access to the view preview or video element for display. You can assign this view to the LayoutManager for display as the Local Preview or the Remote View.
    Returns null if no view has been created.

    Returns: HTMLElement

    Implementation of: IExternalLocalMedia

    Inherited from: Media

    Defined in: Generated/TypeScript/fm.liveswitch/Media.ts:250


    getViewSink

    ▸ getViewSink(): DomVideoSink

    Gets the video view sink if video is not disabled. ViewSink controls the view which displays the video.
    For example, in HTML the element is the view managed by the view sink. Call this method if you want to transform the view, like, for instance, adjusting its resolution or frame rates.

    Returns: DomVideoSink

    Implementation of: IExternalLocalMedia

    Inherited from: Media

    Defined in: Generated/TypeScript/fm.liveswitch/Media.ts:258


    grabVideoFrame

    ▸ grabVideoFrame(): Future<VideoBuffer>

    Gets the next frame from the video track once it is rendered.
    If there are multiple video tracks in a custom media stack, this method calls into the first video track.
    This method could be used for asynchronous video processing or analysis.

    Returns: Future<VideoBuffer>

    Implementation of: IExternalLocalMedia

    Inherited from: Media

    Defined in: Generated/TypeScript/fm.liveswitch/Media.ts:147


    removeOnAudioDestroyed

    ▸ removeOnAudioDestroyed(value: IAction0): void

    Removes a handler set to raise when the audio object is destroyed.

    Parameters:

    Name Type
    value IAction0

    Returns: void

    Implementation of: IExternalLocalMedia

    Inherited from: Media

    Defined in: Generated/TypeScript/fm.liveswitch/Media.ts:28


    removeOnAudioLevel

    ▸ removeOnAudioLevel(value: IAction1<number>): void

    Removes a handler that gives audio level updates for the media.

    Parameters:

    Name Type
    value IAction1<number>

    Returns: void

    Implementation of: IExternalLocalMedia

    Inherited from: Media

    Defined in: Generated/TypeScript/fm.liveswitch/Media.ts:154


    removeOnAudioMuted

    ▸ removeOnAudioMuted(value: IAction0): void

    Parameters:

    Name Type
    value IAction0

    Returns: void

    Implementation of: IExternalLocalMedia

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:30


    removeOnAudioStarted

    ▸ removeOnAudioStarted(value: IAction0): void

    Removes a handler on this media that was set to raise when the audio track is started.
    If there are multiple audio tracks in a custom media stack, this method calls into the first audio track.

    Parameters:

    Name Type
    value IAction0

    Returns: void

    Implementation of: IExternalLocalMedia

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:79


    removeOnAudioStopped

    ▸ removeOnAudioStopped(value: IAction0): void

    Removes a handler on this media that was set to raise when the audio track is stopped.
    If there are multiple audio tracks in a custom media stack, this method calls into the first audio track.

    Parameters:

    Name Type
    value IAction0

    Returns: void

    Implementation of: IExternalLocalMedia

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:87


    removeOnAudioUnmuted

    ▸ removeOnAudioUnmuted(value: IAction0): void

    Parameters:

    Name Type
    value IAction0

    Returns: void

    Implementation of: IExternalLocalMedia

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


    removeOnVideoDestroyed

    ▸ removeOnVideoDestroyed(value: IAction0): void

    Removes a handler set to raise when the video object is destroyed.

    Parameters:

    Name Type
    value IAction0

    Returns: void

    Implementation of: IExternalLocalMedia

    Inherited from: Media

    Defined in: Generated/TypeScript/fm.liveswitch/Media.ts:35


    removeOnVideoMuted

    ▸ removeOnVideoMuted(value: IAction0): void

    Parameters:

    Name Type
    value IAction0

    Returns: void

    Implementation of: IExternalLocalMedia

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:36


    removeOnVideoSize

    ▸ removeOnVideoSize(value: IAction1<Size>): void

    Removes a registered function that provides updates about the media’s video size.

    Parameters:

    Name Type
    value IAction1<Size>

    Returns: void

    Implementation of: IExternalLocalMedia

    Inherited from: Media

    Defined in: Generated/TypeScript/fm.liveswitch/Media.ts:161


    removeOnVideoSizeChange

    ▸ removeOnVideoSizeChange(value: IAction1<Size>): void

    Parameters:

    Name Type
    value IAction1<Size>

    Returns: void

    Implementation of: IExternalLocalMedia

    Inherited from: Media

    Defined in: Generated/TypeScript/fm.liveswitch/Media.ts:164


    removeOnVideoStarted

    ▸ removeOnVideoStarted(value: IAction0): void

    Removes a handler on this media that was set to raise when the video track starts.
    If there are multiple video tracks in a custom media stack, this method calls into the first video track.

    Parameters:

    Name Type
    value IAction0

    Returns: void

    Implementation of: IExternalLocalMedia

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


    removeOnVideoStopped

    ▸ removeOnVideoStopped(value: IAction0): void

    Removes a handler on this media that was set to raise when the video track is stopped.
    If there are multiple video tracks in a custom media stack, this method calls into the first video track.

    Parameters:

    Name Type
    value IAction0

    Returns: void

    Implementation of: IExternalLocalMedia

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:103


    removeOnVideoUnmuted

    ▸ removeOnVideoUnmuted(value: IAction0): void

    Parameters:

    Name Type
    value IAction0

    Returns: void

    Implementation of: IExternalLocalMedia

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:39


    setAudioEncodings

    ▸ setAudioEncodings(value: AudioEncodingConfig[]): void

    Sets the local audio encoding configurations. Audio encodings cannot be empty, so if you set an encoding with a null value or an empty array, this method creates an empty array with one AudioEncodingConfig in it.
    If a new audio encodings array has the same number of encodings as the current one, the new audio encodings are applied to the local media’s audio track. Otherwise, an exception is thrown because the number of audio encodings cannot be changed once they are set.

    Parameters:

    Name Type
    value AudioEncodingConfig[]

    Returns: void

    Implementation of: IExternalLocalMedia

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:125


    setAudioGain

    ▸ setAudioGain(value: number): void

    Sets the gain (input amplification) of the audio track. Any value greater than or equal to 0.0 is valid. The default value is 1. If there are multiple audio tracks in a custom media stack, this method calls into the first audio track.

    Parameters:

    Name Type
    value number

    Returns: void

    Implementation of: IExternalLocalMedia

    Inherited from: Media

    Defined in: Generated/TypeScript/fm.liveswitch/Media.ts:171


    setAudioInput

    ▸ setAudioInput(audioInput: SourceInput): void

    deprecated Use setAudioSourceInput instead.

    Parameters:

    Name Type
    audioInput SourceInput

    Returns: void

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:385


    setAudioLevelInterval

    ▸ setAudioLevelInterval(value: number): void

    Sets the interval in milliseconds between audio level events.

    Parameters:

    Name Type
    value number

    Returns: void

    Implementation of: IExternalLocalMedia

    Inherited from: Media

    Defined in: Generated/TypeScript/fm.liveswitch/Media.ts:178


    setAudioMuted

    ▸ setAudioMuted(value: boolean): void

    Sets the audio track to mute. This method silences audio but does not disable the audio source or prevent its data from flowing through the processing pipeline.
    If there are multiple audio tracks in a custom media stack, this method calls into the first audio track.

    Parameters:

    Name Type
    value boolean

    Returns: void

    Implementation of: IExternalLocalMedia

    Inherited from: Media

    Defined in: Generated/TypeScript/fm.liveswitch/Media.ts:186


    setAudioSimulcastDisabled

    ▸ setAudioSimulcastDisabled(value: boolean): void

    Sets the audio simulcast to disabled.

    Parameters:

    Name Type
    value boolean

    Returns: void

    Implementation of: IExternalLocalMedia

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:413


    setAudioSimulcastEncodingCount

    ▸ setAudioSimulcastEncodingCount(value: number): void

    Sets the maximum number of simulcast encodings that this media produces for the audio stream. The LiveSwitch Media Server accepts a maximum of four encodings.
    The number of encodings cannot be changed once they are set.
    This method must be called before the media starts.

    Parameters:

    Name Type
    value number

    Returns: void

    Implementation of: IExternalLocalMedia

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:429


    setAudioSimulcastPreferredBitrate

    ▸ setAudioSimulcastPreferredBitrate(value: number): void

    Sets the preferred bitrate for audio simulcast in Kbps. The bitrate must be a positive integer.

    Parameters:

    Name Type
    value number

    Returns: void

    Implementation of: IExternalLocalMedia

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:443


    setAudioSourceInput

    ▸ setAudioSourceInput(value: SourceInput): void

    Sets the audio source input for the media.
    The audio source input can only be set before the media has started. If the audio source input is not set, then the default input device is used.
    If you want to change the input after the media has started, call changeAudioSourceInput instead. ChangeAudioSourceInput stops the current audio input and switch to the new input.
    See getVideoSourceInputs and getAudioSourceInputs for details on how to get the ID and name properties for each source input.

    Parameters:

    Name Type
    value SourceInput

    Returns: void

    Implementation of: IExternalLocalMedia

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:300


    setAudioVolume

    ▸ setAudioVolume(value: number): void

    Sets the audio volume on the audio track. Valid values range between 0.0 and 1.0. A value of 1.0 indicates that there is no output resistance and audio plays at the input level. A value of 0.0 mutes the audio.
    If there are multiple audio tracks in a custom media stack, this method calls into the first audio track.

    Parameters:

    Name Type
    value number

    Returns: void

    Implementation of: IExternalLocalMedia

    Inherited from: Media

    Defined in: Generated/TypeScript/fm.liveswitch/Media.ts:194


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

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


    setId

    ▸ setId(value: string): void

    Sets the unique media identifier.

    Parameters:

    Name Type
    value string

    Returns: void

    Implementation of: IExternalLocalMedia

    Inherited from: Media

    Defined in: Generated/TypeScript/fm.liveswitch/Media.ts:201


    setVideoEncodings

    ▸ setVideoEncodings(value: VideoEncodingConfig[]): void

    Sets the local video encoding configurations. Video encodings cannot be empty, so if you set the value of this method to null or an empty array, an exception is thrown.
    The number of video encodings cannot be changed once set. If the number of new video encodings is different from the existing number of video encodings, an error is thrown. If a new video encoding array has the same number of encodings as the current one, the encodings are applied to the media’s VP8, VP9, H.264, and H.265 controllers, converters, encoders, and packetizers.

    Parameters:

    Name Type
    value VideoEncodingConfig[]

    Returns: void

    Implementation of: IExternalLocalMedia

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:148


    setVideoInput

    ▸ setVideoInput(videoInput: SourceInput): void

    deprecated Use setVideoSourceInput instead.

    Parameters:

    Name Type
    videoInput SourceInput

    Returns: void

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:392


    setVideoMuted

    ▸ setVideoMuted(value: boolean): void

    Mutes or unmutes video for LocalMedia. For example, if you call setVideoMuted before joining a channel, your video is muted when you join.
    If there are multiple video tracks in a custom media stack, this method calls into the first video track.

    Parameters:

    Name Type
    value boolean

    Returns: void

    Implementation of: IExternalLocalMedia

    Inherited from: Media

    Defined in: Generated/TypeScript/fm.liveswitch/Media.ts:209


    setVideoSimulcastBitsPerPixel

    ▸ setVideoSimulcastBitsPerPixel(value: number): void

    Sets the video simulcast bits per pixel (bpp). The bits per pixel value must be greater than or equal to zero.
    If the video source has declared a target width, height, and frame rate, and setVideoSimulcastBitsPerPixel has a set value, then the encoding bitrates are calculated with setVideoSimulcastBitsPerPixel’s value instead of the preferred bitrate.

    Parameters:

    Name Type
    value number

    Returns: void

    Implementation of: IExternalLocalMedia

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:500


    setVideoSimulcastDegradationPreference

    ▸ setVideoSimulcastDegradationPreference(value: VideoDegradationPreference): void

    Sets the video’s simulcast degradation preference.
    The following degradation preferences can be set:
    Automatic: Prefers to automate degradation based on video type. A Screen video type prefers to degrade FrameRate. A Camera video type prefers to degrade Resolution. An unknown video type prefers a Balanced approach.
    Balanced: Prefers to degrade both FrameRate and Resolution together in smaller increments.
    FrameRate: Prefers to degrade FrameRate instead of Resolution.
    Resolution: Prefers to degrade Resolution instead of FrameRate.

    Parameters:

    Name Type
    value VideoDegradationPreference

    Returns: void

    Implementation of: IExternalLocalMedia

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:524


    setVideoSimulcastDisabled

    ▸ setVideoSimulcastDisabled(value: boolean): void

    Sets whether video simulcast is disabled. If true, video simulcast is disabled. If false, video simulcast is enabled.

    Parameters:

    Name Type
    value boolean

    Returns: void

    Implementation of: IExternalLocalMedia

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:457


    setVideoSimulcastEncodingCount

    ▸ setVideoSimulcastEncodingCount(value: number): void

    Sets the maximum number of simulcast encodings that this LocalMedia produces for the video stream. The default value is 2. For LiveSwitch Media Server, the maximum is 4 encodings. This method must be called before the LocalMedia starts.

    Parameters:

    Name Type
    value number

    Returns: void

    Implementation of: IExternalLocalMedia

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:471


    setVideoSimulcastPreferredBitrate

    ▸ setVideoSimulcastPreferredBitrate(value: number): void

    Sets the preferred bitrate of a video simulcast in Kbps. The bitrate must be a positive integer.

    Parameters:

    Name Type
    value number

    Returns: void

    Implementation of: IExternalLocalMedia

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:485


    setVideoSourceInput

    ▸ setVideoSourceInput(value: SourceInput): void

    Sets the video source input for the media.
    The video source input can only be set before the media has started. If the video source input is not set, then the default input device is used.
    If you want to change the input after the media has started, call changeVideoSourceInput instead. ChangeVideoSourceInput stops the current audio input and switch to the new input.
    See getVideoSourceInputs and getAudioSourceInputs for details on how to get the ID and name properties for each source input.

    Parameters:

    Name Type
    value SourceInput

    Returns: void

    Implementation of: IExternalLocalMedia

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:310


    start

    ▸ start(): Future<LocalMedia>

    Starts media track sources. This method does not take any parameters and executes asynchronously. Call this method when LocalMedia's state is New or Stopped. If you call this method when LocalMedia's state is not New or Stopped, then the Future returned by this method is rejected.

    Returns: Future<LocalMedia>

    Implementation of: IExternalLocalMedia

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:317


    stop

    ▸ stop(): Future<LocalMedia>

    Stops media track sources. This method does not take any parameters and executes asynchronously. Call this method when LocalMedia has started. If you call this method when LocalMedia has not started, then the Future returned by this method is rejected.

    Returns: Future<LocalMedia>

    Implementation of: IExternalLocalMedia

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:330


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

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


    canScreenShare

    ▸ StaticcanScreenShare(): boolean

    Checks if the media can screen share.

    Returns: boolean

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:209


    getChromeExtensionId

    ▸ StaticgetChromeExtensionId(): string

    Gets the Chrome screen share extension ID.
    See setChromeExtensionId for more information.

    deprecated Use fm.liveswitch.Plugin.getChromeExtensionId() instead.

    Returns: string

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:157


    getChromeExtensionInstalled

    ▸ StaticgetChromeExtensionInstalled(): boolean

    Checks if the Chrome screen share extension is installed. Returns true if the Chrome screen share extension is installed and false otherwise.
    See setChromeExtensionId for more information.

    deprecated Use fm.liveswitch.Plugin.getChromeExtensionInstalled() instead.

    Returns: boolean

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:184


    getChromeExtensionRequiresUserGesture

    ▸ StaticgetChromeExtensionRequiresUserGesture(): boolean

    Checks if a user gesture is required to install the Chrome screen share extension. Returns true if a user gesture is required. If no user gesture is required, the extension is downloaded and installed automatically.
    See setChromeExtensionId for more information.

    deprecated Use fm.liveswitch.Plugin.getChromeExtensionRequiresUserGesture() instead.

    Returns: boolean

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:193


    getChromeExtensionUrl

    ▸ StaticgetChromeExtensionUrl(): string

    Gets the URL of the Chrome screen share extension on the Google Chrome Web Store. The URL is used to download the screen share extension or provide a link to users they can use to download and install the extension.
    See setChromeExtensionId for more information.

    deprecated Use fm.liveswitch.Plugin.getChromeExtensionUrl() instead.

    Returns: string

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:175


    setChromeExtensionId

    ▸ StaticsetChromeExtensionId(chromeExtensionId: string): void

    Sets the ID of the Chrome screen sharing extension.
    Chrome browsers version 71 or older require an extension to share their screen. In the LiveSwitch Web Client SDK, there is an example of the extension that implements screen sharing in Web/Libraries/fm.liveswitch.chrome. Upload this package to the Chrome Web Store to give the extension a unique ID. Use setChromeExtensionId to set this ID. Only set this value if you are using a version of Chrome older than version 72.

    deprecated Use fm.liveswitch.Plugin.setChromeExtensionId() instead.

    Parameters:

    Name Type
    chromeExtensionId string

    Returns: void

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:166


    setChromeExtensionRequiresUserGesture

    ▸ StaticsetChromeExtensionRequiresUserGesture(chromeExtensionRequiresUserGesture: boolean): void

    Sets if a user gesture is required to install the Chrome screen share extension. If no user gesture is required, the extension is downloaded and installed automatically.
    See setChromeExtensionId for more information.

    deprecated Use fm.liveswitch.Plugin.setChromeExtensionRequiresUserGesture() instead.

    Parameters:

    Name Type
    chromeExtensionRequiresUserGesture boolean

    Returns: void

    Defined in: Generated/TypeScript/fm.liveswitch/LocalMedia.ts:202

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