RTMP Events - React Native
VideoSDK provides onLivestreamStateChanged
event which will notify you of the current state of livestream for the meeting.
onLivestreamStateChanged
- This event will be triggered when the meeting's livestream status changed.
- This event can be subscribed from the
useMeeting
hook.
Example
Here is the usage of the event mentioned in this page.
import { Constants, useMeeting } from "@videosdk.live/react-native-sdk";
function onLivestreamStateChanged(data) {
const { status } = data;
if (status === Constants.livestreamEvents.LIVESTREAM_STARTING) {
console.log("Meeting livestream is starting");
} else if (status === Constants.livestreamEvents.LIVESTREAM_STARTED) {
console.log("Meeting livestream is started");
} else if (status === Constants.livestreamEvents.LIVESTREAM_STOPPING) {
console.log("Meeting livestream is stopping");
} else if (status === Constants.livestreamEvents.LIVESTREAM_STOPPED) {
console.log("Meeting livestream is stopped");
} else {
//
}
}
const {
meetingId
...
} = useMeeting({
onLivestreamStateChanged,
...
});
API Reference
The API references for all the methods and events utilised in this guide are provided below.
Got a Question? Ask us on discord