Function useTrackEvent

  • Occurs when a audio or video track ends.

    Reasons may include:

    • Camera is unplugged.
    • Microphone is unplugged.
    • The local user stops screen sharing.
    • The local user closes the underlying MediaStreamTrack.
    • A local media device malfunctions.
    • The device permission is revoked.

    Parameters

    • track: Nullable<ILocalTrack>
    • event: "track-ended"
    • listener: Nullable<(() => void)>

    Returns void

  • Occurs when the state of processing the audio buffer in [BufferSourceAudioTrack]IBufferSourceAudioTrack changes.

    Parameters

    • track: Nullable<IBufferSourceAudioTrack>
    • event: "source-state-change"
    • listener: Nullable<((currentState) => void)>

    Returns void

  • Occurs when a audio or video track ends.

    Reasons may include:

    • Camera is unplugged.
    • Microphone is unplugged.
    • The local user stops screen sharing.
    • The local user closes the underlying MediaStreamTrack.
    • A local media device malfunctions.
    • The device permission is revoked.

    Parameters

    • track: Nullable<ILocalVideoTrack>
    • event: "track-ended"
    • listener: Nullable<(() => void)>

    Returns void

  • Since
       4.8.0

    Indicates the visibility of the <video> HTML tag.

    The SDK triggers this event every 30 seconds.

    After you call localVideoTrack.play, the SDK creates an <video> tag for playing video tracks. When localVideoTrack.isPlaying is true but you cannot see any video, this event helps you check whether the <video> tag is visible or not and learn the reason when the <video> tag is invisible.

    Parameters

    • track: Nullable<ILocalVideoTrack>
    • event: "video-element-visible-status"
    • listener: Nullable<(() => void)>

    Returns void

  • Occurs when the first remote audio or video frame is decoded.

    Parameters

    • track: Nullable<IRemoteTrack>
    • event: "first-frame-decoded"
    • listener: Nullable<(() => void)>

    Returns void

  • Since
       4.8.0

    Indicates the visibility of the <video> HTML tag.

    The SDK triggers this event every 30 seconds.

    After you call localVideoTrack.play, the SDK creates an <video> tag for playing video tracks. When localVideoTrack.isPlaying is true but you cannot see any video, this event helps you check whether the <video> tag is visible or not and learn the reason when the <video> tag is invisible.

    Parameters

    • track: Nullable<IRemoteVideoTrack>
    • event: "video-element-visible-status"
    • listener: Nullable<((data?) => void)>

    Returns void