Skip to main content
Version: 2.x.x

useRTCStream Hook Methods - React Native

resume()​

  • resume() resumes a remote participant's stream that you paused. stream.resume() does the same.

  • Only a stream this device receives from a remote participant can be resumed.

Returns​

  • Promise<void>. It rejects with:
    • 3068 (ERROR_ACTION_NOT_SUPPORTED) when this device does not receive the stream, for example your own stream.
    • 3054 (ERROR_ALREADY_IN_REQUESTED_STATE) when the stream is not paused.
    • 3035 (ERROR_ACTION_PERFORMED_BEFORE_ROOM_JOINED) before you join, or when the stream is no longer in the room.
    • 3065 (ERROR_ROOM_RECONNECTING) while the room is reconnecting.
    • 4075 (RESUME_STREAM_FAILED) when the server refuses the request.
    • 3079 (ERROR_OPERATION_TIMED_OUT) when the request times out.

pause()​

  • pause() stops receiving a remote participant's stream on this device. stream.pause() does the same.

  • Only a stream this device receives from a remote participant can be paused. The participant keeps sending it to everyone else.

Returns​

  • Promise<void>. It rejects with:
    • 3068 (ERROR_ACTION_NOT_SUPPORTED) when this device does not receive the stream, for example your own stream.
    • 3054 (ERROR_ALREADY_IN_REQUESTED_STATE) when the stream is already paused.
    • 3035 (ERROR_ACTION_PERFORMED_BEFORE_ROOM_JOINED) before you join, or when the stream is no longer in the room.
    • 3065 (ERROR_ROOM_RECONNECTING) while the room is reconnecting.
    • 4074 (PAUSE_STREAM_FAILED) when the server refuses the request.
    • 3079 (ERROR_OPERATION_TIMED_OUT) when the request times out.

Got a Question? Ask us on discord


Was this helpful?

Not helpfulHelpful