100mslive / 100ms-react-native

React Native Live Streaming, Video Conferencing SDK & Sample App
https://www.100ms.live/
MIT License
82 stars 31 forks source link

callback for handling meeting leave #1147

Closed stanwolverine closed 1 year ago

stanwolverine commented 1 year ago

Description

This PR adds onMeetingLeave prop to HMSPrebuilt component. Users can pass a callback to HMSPrebuilt component using onMeetingLeave prop, and then the callback will be called when the meeting is ended or user is removed from the room.

User can use this callback to navigate app user to some screen on end of meeting.

const handleMeetingLeave = () => {
    navigation.navigate('<some screen>');
}

...

<HMSPrebuilt
    roomCode={"abc-defg-hij"}
    onMeetingLeave={handleMeetingLeave}
/>

Before:

https://github.com/100mslive/100ms-react-native/assets/45194090/a722b38a-e150-471f-a972-d0e4f320950d

After:

https://github.com/100mslive/100ms-react-native/assets/45194090/8f310ada-a293-40fe-b278-b1a75b575903

Pre-launch Checklist