The FFCLocalAudioTrack class represents a local audio track in the FlipFlopCloud SDK. It extends the FFCLocalTrack class and provides additional functionality specific to local audio tracks.

Hierarchy (View Summary)

Implements

  • IFFCLocalAudioTrack

Constructors

  • Creates an instance of FFCLocalAudioTrack.

    Parameters

    • mediaTrack: MediaStreamTrack

      A MediaStreamTrack instance.

    • Optionalconstraints: MediaTrackConstraints

      (Optional) Media constraints for the track.

    • OptionaluserProvidedTrack: boolean

      (Optional) Whether the track is user-provided.

    • OptionalaudioContext: AudioContext

      (Optional) The AudioContext instance for the track.

    • OptionalloggerOptions: FFCLoggerOptions

      (Optional) Logger options for the track.

    Returns FFCLocalAudioTrack

Accessors

  • get attachedElements(): HTMLMediaElement[]

    Gets the HTML media elements attached to the track.

    Returns HTMLMediaElement[]

    An array of HTMLMediaElement instances.

  • get codec(): undefined | "vp8" | "h264" | "vp9" | "av1"

    Gets the codec used by the track.

    Returns undefined | "vp8" | "h264" | "vp9" | "av1"

    The codec as an FFCVideoCodec, or undefined if not set.

  • get constraints(): MediaTrackConstraints

    Gets the media constraints applied to the track.

    Returns MediaTrackConstraints

    The media constraints as MediaTrackConstraints.

  • get currentBitrate(): number

    Gets the current bitrate of the track.

    Returns number

    The current bitrate in bits per second.

  • get dimensions(): undefined | Dimensions

    Gets the dimensions of the track (e.g., width and height).

    Returns undefined | Dimensions

    The dimensions as FFCTrack.Dimensions, or undefined if not available.

  • get enhancedNoiseCancellation(): boolean

    Indicates whether enhanced noise cancellation is enabled for the audio track.

    Returns boolean

    true if enhanced noise cancellation is enabled, otherwise false.

  • get id(): string

    Gets the unique identifier of the track.

    Returns string

    The track ID as a string.

  • get isLocal(): boolean

    Indicates whether the track is local.

    Returns boolean

    true because this is a local track.

  • get isMuted(): boolean

    Checks if the track is muted.

    Returns boolean

    true if the track is muted, otherwise false.

  • get isUpstreamPaused(): boolean

    Checks if the upstream of the track is paused.

    Returns boolean

    true if the upstream is paused, otherwise false.

  • get isUserProvided(): boolean

    Checks if the track was provided by the user.

    Returns boolean

    true if the track is user-provided, otherwise false.

  • get kind(): TrackKind

    Gets the kind of the track (e.g., audio, video).

    Returns TrackKind

    The track kind as TrackKind.

  • set mediaStream(mediaStream: undefined | MediaStream): void

    Sets the media stream associated with the track.

    Parameters

    • mediaStream: undefined | MediaStream

      The MediaStream instance, or undefined to clear it.

    Returns void

  • get mediaStreamTrack(): MediaStreamTrack

    Gets the MediaStreamTrack associated with the track.

    Returns MediaStreamTrack

    The MediaStreamTrack instance.

  • get sid(): undefined | string

    Gets the streamd id (SID) of the track.

    Returns undefined | string

    The track SID, or undefined if not set.

  • set source(source: Source): void

    Sets the source of the track (e.g., camera, microphone).

    Parameters

    • source: Source

      The source of the track as FFCTrack.Source.

    Returns void

  • get streamState(): StreamState

    Gets the stream state of the track (e.g., active, paused).

    Returns StreamState

    The stream state as FFCTrack.StreamState.

Methods

  • Creates a new HTMLAudioElement or HTMLVideoElement, attaches to it, and returns it.

    Returns HTMLMediaElement

    The attached HTMLMediaElement.

  • Attaches track to an existing HTMLAudioElement or HTMLVideoElement

    Parameters

    • element: HTMLMediaElement

      (Optional) The HTMLMediaElement to attach the track to.

    Returns HTMLMediaElement

    The attached HTMLMediaElement.

  • Checks if the audio track is silent.

    Returns Promise<boolean>

    A promise that resolves to true if the track is silent, otherwise false.

  • Detaches from all attached elements

    Returns HTMLMediaElement[]

    The detached HTMLMediaElement or an array of detached elements.

  • Detach from a single element.

    Parameters

    • element: HTMLMediaElement

      (Optional) The HTMLMediaElement to detach the track from.

    Returns HTMLMediaElement

    The detached HTMLMediaElement or an array of detached elements.

  • Gets the device ID of the track.

    Parameters

    • normalize: boolean

      Whether to normalize the device ID.

    Returns Promise<undefined | string>

    A promise that resolves to the device ID as a string, or undefined if not available.

  • Retrieves the RTC stats report for the track.

    Returns Promise<undefined | RTCStatsReport>

    A promise that resolves to an RTCStatsReport, or undefined if not available.

  • Retrieves the sender statistics for the audio track.

    Returns Promise<undefined | FFCAudioSenderStats>

    A promise that resolves to the sender statistics as FFCAudioSenderStats, or undefined if not available.

  • Pauses the upstream of the track.

    Returns Promise<void>

    A promise that resolves when the upstream is paused.

  • Resumes the upstream of the track.

    Returns Promise<void>

    A promise that resolves when the upstream is resumed.

  • Sets the device ID for the track.

    Parameters

    • deviceId: ConstrainDOMString

      The device ID to set.

    Returns Promise<boolean>

    A promise that resolves to true if the device ID was set successfully, otherwise false.

  • Stops the processor applied to the track.

    Returns Promise<void>

    A promise that resolves when the processor is stopped.

  • Waits for the dimensions of the track to be available.

    Parameters

    • timeoutMs: number = 1000

      The timeout in milliseconds (default is 1000ms).

    Returns Promise<Dimensions>

    A promise that resolves to the dimensions as FFCTrack.Dimensions.