Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(react-native): live stream components for host and viewer #1135

Merged
merged 24 commits into from
Oct 19, 2023

Conversation

khushal87
Copy link
Member

@khushal87 khushal87 commented Oct 10, 2023

This PR focuses on introducing the LiveStream components for RN SDK.

This focuses on two main components:

Almost all of the subcomponents within the above two components are customizable. The components are mainly divided into the TopView, Layout, and Controls components.

The TopView component internally consists of DurationBadge, LiveIndicator, and FollowerCount component that displays the duration of the live stream, whether the live stream is active and the follower count displays the number of people lives in the call.

The Controls View consists of HostStartStreamButton, ViewerLeaveStreamButton, and the LiveStreamMediaControls.

The LiveStreamLayout component is responsible for showing the screen sharing and the video stream of the host.

The component docs are also added.

@khushal87 khushal87 marked this pull request as ready for review October 11, 2023 12:54
refactor: change component names

refactor: change component names

refactor: remove livestream dir to solve case issue

refactor: remove livestream dir to solve case issue

refactor: change component names

refactor: change component names and directory structure
@khushal87 khushal87 force-pushed the khushal87/react-native-livestream-components branch from a0bc93c to 251f33d Compare October 17, 2023 07:05
- A complete live stream UI with ability to stream host's video.
- Duration of the live stream with live indicator.
- Whether the stream is live and number of participant's watching the stream.
- Media controls to control publish and un-publish stream.
Copy link
Contributor

@vishalnarkhede vishalnarkhede Oct 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Media controls to control publish and un-publish stream.
- Media controls to start and end the livestream.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done ✅

Comment on lines 57 to 58
call?.off('call.live_started', handleLiveStarted);
call?.off('call.updated', handleLiveEnded);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of off, use the unsubscribe functions returned by on function. We ran into some issue with current approach on chat in the past.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{
backgroundColor: colors.static_grey,
},
hostLiveStream.container,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
hostLiveStream.container,
hostLivestream.container,

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check if there are any more such instances needed to be fixed


const onStartStreamButtonPress = async () => {
if (onStartStreamHandler) {
onStartStreamHandler();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't we return after this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the other handler related props that we have in SDK, are implemented with purpose of being able to replace default logic. So I think we should be consistent.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Thanks for spotting it. 😄

height: iconSizes.sm,
width: iconSizes.sm,
},
liveStreamAudioControlButton.icon,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
liveStreamAudioControlButton.icon,
livestreamAudioControlButton.icon,

@@ -0,0 +1,5 @@
Component to customize the leave stream button on the viewer's end live stream.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Component to customize the leave stream button on the viewer's end live stream.
Component to customize the leave stream button for the viewer.

Just simplifying the language

@@ -0,0 +1,5 @@
Handler to be called when the viewer's leave stream button is called.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Handler to be called when the viewer's leave stream button is called.
Handler to be called when the leave stream button is pressed by the viewer.

@vishalnarkhede vishalnarkhede merged commit 5a5f0e1 into main Oct 19, 2023
14 checks passed
@vishalnarkhede vishalnarkhede deleted the khushal87/react-native-livestream-components branch October 19, 2023 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants