Skip to main content
Version: 0.1.x

Pause/Resume Video Stream - React Native

Whenver you wish to stop/resume downlaod stream(webcam, screenShare and mic) of participant, you can simply do it by using pause, resume methods.

Pause video stream

  • pause() method is used for pause stream(webcam, screenShare and mic) of a particular participant.
import { useParticipant } from "@videosdk.live/react-native-sdk";

const ParticipantView = () => {
// get stream of particular participant
const { webcamStream, micStream, screenShareStream } =
useParticipant("<ParticipantId>");

const onPress = () => {
// pause video stream
webcamStream.pause();

// pause mic stream
micStream.pause();

// pause screen share stream
screenShareStream.pause();
};

return <>...</>;
};

Resume video stream

  • resume() method is used to resume stream(webcam, screenShare and mic) of a particular participant.
import { useParticipant } from "@videosdk.live/react-native-sdk";

const ParticipantView = () => {
// get stream of particular participant
const { webcamStream, micStream, screenShareStream } =
useParticipant("<ParticipantId>");

const onPress = () => {
// resume video stream
webcamStream.resume();

// resume mic stream
micStream.resume();

// resume screen share stream
screenShareStream.resume();
};

return <>...</>;
};

Got a Question? Ask us on discord