Function facingModeFromLocalTrack

  • Experimental

    Try to analyze the local track to determine the facing mode of a track.

    Parameters

    • localTrack: MediaStreamTrack | LocalTrack<Kind>
    • options: FacingModeFromLocalTrackOptions = {}

    Returns FacingModeFromLocalTrackReturnValue

    Remarks

    There is no property supported by all browsers to detect whether a video track originated from a user- or environment-facing camera device. For this reason, we use the facingMode property when available, but will fall back on a string-based analysis of the device label to determine the facing mode. If both methods fail, the default facing mode will be used.

    See

    MDN docs on facingMode