Class FFCTrack<TrackKind>Abstract

The FFCTrack class is an abstract base class for handling media tracks in the FlipFlopCloud SDK. It extends EventEmitter to emit various events related to track state changes.

Type Parameters

  • TrackKind extends Kind = Kind

    The type of the track, which defaults to FFCTrack.Kind.

Hierarchy (View Summary)

Implements

Accessors

  • get attachedElements(): HTMLMediaElement[]

    Gets the HTML media elements attached to the track.

    Returns HTMLMediaElement[]

    An array of HTMLMediaElement instances.

  • get currentBitrate(): number

    Gets the current bitrate of the track.

    Returns number

    The current bitrate in bits per second.

  • get isLocal(): boolean

    Checks if the track is local.

    Returns boolean

    true if the track is local, otherwise false.

  • get isMuted(): boolean

    Checks if the track is muted.

    Returns boolean

    true if the track is muted, otherwise false.

  • 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.

  • get source(): Source

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

    Returns Source

    The track source as FFCTrack.Source.

  • 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.

  • 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.