React Native Api Reference - v2.0.0
    Preparing search index...

    Class RTCStream

    RTCStream is one media stream a participant is producing — their camera, microphone, screen share or screen-share audio.

    Streams arrive through useParticipant's webcamStream / micStream / screenShareStream / screenShareAudioStream, and through its onStreamEnabled and onStreamDisabled events. useRTCStream wraps one by id and exposes the same pause / resume pair.

    Index
    id: string
    • Id of the stream.
    kind: "audio" | "video" | "share" | "shareAudio"
    • Which of the participant's four media surfaces this stream carries.
    • The track to render or play, for RTCView by way of new MediaStream([stream.track]).toURL().
      • Removes a listener added with on.

      Parameters

      • eventType: "state"

        The event to unsubscribe from.

      • listener: (data: any) => void

        The same function that was passed to on.

      Returns void

      • Subscribes to this stream's own events. state carries {state, timestamp} and is what useRTCStream's onStreamStateChanged surfaces.

      Parameters

      • eventType: "state"

        The event to subscribe to.

      • listener: (data: any) => void

        Called when the event fires.

      Returns void

      • Pauses this incoming stream, so the SDK stops consuming it while the participant keeps producing it.

      • Receive-side only. The native SDKs reject a local stream with VideoSDKError.ERROR_ACTION_NOT_SUPPORTED and an already-paused one with VideoSDKError.ERROR_STREAM_ALREADY_PAUSED.

      Returns Promise<void>

      • Resumes a paused incoming stream.

      • Receive-side only, with the same restrictions as pause.

      Returns Promise<void>