Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.

feat: sync webapp #688

Merged
merged 51 commits into from
Dec 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
95e10a5
fix: remove screen share and pdf share icons from react-icons (#1624)
saikatmitra91 Aug 16, 2023
a577337
fix: remove hls.js dependency from web app and roomkit (#1622)
saikatmitra91 Aug 16, 2023
46be945
Merge branch 'main' into dev
raviteja83 Aug 17, 2023
53ac1d5
feat: hls chat ui
KaustubhKumar05 Aug 18, 2023
6309dce
feat: merge main to dev
raviteja83 Aug 18, 2023
1702509
fix: preview notifications
KaustubhKumar05 Aug 24, 2023
8f50bda
build: update versions for release
github-actions[bot] Aug 25, 2023
07e5c5f
Dev to main (#1718)
saikatmitra91 Aug 25, 2023
7acc742
Dev to main (#1721)
saikatmitra91 Aug 25, 2023
d2a0568
feat: mid call preview
eswarclynn Aug 28, 2023
35ed682
Merge branch 'dev'
raviteja83 Aug 29, 2023
3d08d56
feat: viewer on stage flow
eswarclynn Aug 30, 2023
71ab2f4
Merge branch 'dev'
raviteja83 Aug 30, 2023
53bac81
build: update versions for alpha release
github-actions[bot] Sep 1, 2023
fdef6e3
build: update versions for alpha release
github-actions[bot] Sep 8, 2023
7c2dc90
build: update versions for alpha release
github-actions[bot] Sep 11, 2023
7455234
build: update versions for alpha release
github-actions[bot] Sep 13, 2023
eb5fbef
PR for main to dev backmerge (#1910)
github-actions[bot] Sep 13, 2023
7a56164
build: update versions for release
raviteja83 Sep 13, 2023
19241cc
Merge main to dev (#1924)
raviteja83 Sep 14, 2023
d68d66e
build: update versions for release
github-actions[bot] Sep 15, 2023
de69188
Merge branch 'dev' into merge-dev-to-main
raviteja83 Sep 20, 2023
e110a4e
build: update versions for release
github-actions[bot] Sep 21, 2023
5157d63
build: update versions for alpha release
github-actions[bot] Sep 27, 2023
06f6980
build: update versions for release
github-actions[bot] Oct 3, 2023
54d1778
feat: add polls to prebuilt
eswarclynn Oct 5, 2023
608dbae
fix: polls design parity
KaustubhKumar05 Oct 13, 2023
047ce6e
build(deps): bump @babel/traverse from 7.19.3 to 7.23.2 (#2049)
dependabot[bot] Oct 18, 2023
33a1b53
build: update versions for release
github-actions[bot] Oct 19, 2023
e0a1fba
build: update versions for alpha release
raviteja83 Oct 19, 2023
9f40b93
build: update versions for release
github-actions[bot] Oct 19, 2023
be40b0e
fix: min options for question
eswarclynn Oct 20, 2023
5eb67e3
PR for main to dev backmerge (#2054)
raviteja83 Oct 29, 2023
ee68da3
build: update versions for release
github-actions[bot] Nov 6, 2023
c333e85
fix: don't override manual selection of audio
raviteja83 Nov 8, 2023
32344cf
build: update versions for release
github-actions[bot] Nov 14, 2023
e90ff13
fix: add pusher cluster env var
eswarclynn Nov 16, 2023
ca310e7
fix: create separate worker threads
github-actions[bot] Nov 17, 2023
a8588f6
fix: conflicts from main (#2145)
KaustubhKumar05 Nov 20, 2023
d8d9966
feat: merge dev to main
raviteja83 Nov 20, 2023
c69a5aa
build: update versions for release (#2166)
github-actions[bot] Nov 21, 2023
9462722
fix: preserve polls on reload
eswarclynn Nov 23, 2023
e104b40
build: update versions for release
github-actions[bot] Nov 28, 2023
98b3d36
build: update versions for release
github-actions[bot] Nov 28, 2023
838b4fc
QA Handover PR (#2163)
raviteja83 Nov 28, 2023
6ec2f60
build: update versions for release
github-actions[bot] Dec 1, 2023
88466f6
fix: cta text for quiz, title for interaction
KaustubhKumar05 Dec 5, 2023
f13aeaf
build: update versions for release
github-actions[bot] Dec 8, 2023
3589e8a
Merge branch 'sync-webapp' of https://github.com/100mslive/100ms-web …
eswarclynn Dec 8, 2023
1c14004
build: update yarn.lock
eswarclynn Dec 8, 2023
0138271
Merge branch 'main' into sync-webapp
eswarclynn Dec 8, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions example.env
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ REACT_APP_DEFAULT_APP_DETAILS='{}'
REACT_APP_ENABLE_STATS_FOR_NERDS='false'
REACT_APP_PUSHER_APP_KEY=''
REACT_APP_PUSHER_AUTHENDPOINT=''
REACT_APP_PUSHER_CLUSTER=''
REACT_APP_HEADLESS_JOIN='false'
REACT_APP_ZIPY_KEY=
REACT_APP_TITLE='100ms App'
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
"src"
],
"dependencies": {
"@100mslive/hls-player": "0.1.13",
"@100mslive/hms-virtual-background": "1.11.13",
"@100mslive/react-icons": "0.8.13",
"@100mslive/react-sdk": "0.8.13",
"@100mslive/roomkit-react": "0.1.4",
"@100mslive/hls-player": "0.1.24",
"@100mslive/hms-virtual-background": "1.11.24",
"@100mslive/react-icons": "0.8.24",
"@100mslive/react-sdk": "0.8.24",
"@100mslive/roomkit-react": "0.1.15",
"@emoji-mart/data": "^1.0.6",
"@emoji-mart/react": "^1.0.1",
"@tldraw/tldraw": "^1.18.4",
Expand Down
2 changes: 1 addition & 1 deletion src/components/Chat/ChatSelector.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ export const ChatSelector = ({ role, peerId, onSelect }) => {
<Box css={{ px: "$8" }}>
<ParticipantSearch
onSearch={setSearch}
placeholder="Search participants"
placeholder="Search for participants"
/>
</Box>
)}
Expand Down
6 changes: 6 additions & 0 deletions src/components/Notifications/Notifications.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import React, { useEffect } from "react";
import { logMessage } from "zipyai";
import {
HMSNotificationTypes,
HMSRoomState,
selectLocalPeerID,
selectRoomState,
useHMSNotifications,
useHMSStore,
} from "@100mslive/react-sdk";
Expand Down Expand Up @@ -36,13 +38,17 @@ export function Notifications() {
const subscribedNotifications = useSubscribedNotifications() || {};
const isHeadless = useIsHeadless();
const toggleWidget = useWidgetToggle();
const roomState = useHMSStore(selectRoomState);

useEffect(() => {
if (!notification) {
return;
}
switch (notification.type) {
case HMSNotificationTypes.METADATA_UPDATED:
if (roomState !== HMSRoomState.Connected) {
return;
}
// Don't toast message when metadata is updated and raiseHand is false.
// Don't toast message in case of local peer.
const metadata = getMetadata(notification.data?.metadata);
Expand Down
10 changes: 9 additions & 1 deletion src/components/Notifications/PeerNotifications.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { useEffect } from "react";
import {
HMSNotificationTypes,
HMSRoomState,
selectRoomState,
useHMSNotifications,
useHMSStore,
} from "@100mslive/react-sdk";
import { ToastBatcher } from "../Toast/ToastBatcher";
import { useSubscribedNotifications } from "../AppData/useUISettings";
Expand All @@ -22,7 +25,12 @@ export const PeerNotifications = () => {
const isPeerLeftSubscribed = useSubscribedNotifications(
SUBSCRIBED_NOTIFICATIONS.PEER_LEFT
);
const roomState = useHMSStore(selectRoomState);

useEffect(() => {
if (roomState !== HMSRoomState.Connected) {
return;
}
if (
!notification ||
(notification?.data?.roleName &&
Expand Down Expand Up @@ -51,7 +59,7 @@ export const PeerNotifications = () => {
return;
}
ToastBatcher.showToast({ notification });
}, [notification, isPeerJoinSubscribed, isPeerLeftSubscribed]);
}, [notification, isPeerJoinSubscribed, isPeerLeftSubscribed, roomState]);

return null;
};
2 changes: 1 addition & 1 deletion src/components/Polls/CreateQuestions/CreateQuestions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export function CreateQuestions() {
};
const headingTitle = interaction?.type
? interaction?.type?.[0]?.toUpperCase() + interaction?.type?.slice(1)
: "Polls/Quiz";
: "Polls and Quizzes";
const isQuiz = interaction?.type === "quiz";
return (
<Container rounded>
Expand Down
10 changes: 6 additions & 4 deletions src/components/Polls/Voting/QuestionCard.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @ts-check
import React, { useCallback, useMemo, useState } from "react";
import {
selectLocalPeerID,
selectLocalPeer,
selectLocalPeerRoleName,
useHMSActions,
useHMSStore,
Expand Down Expand Up @@ -51,11 +51,13 @@ export const QuestionCard = ({
rolesThatCanViewResponses,
}) => {
const actions = useHMSActions();
const localPeerID = useHMSStore(selectLocalPeerID);
const localPeer = useHMSStore(selectLocalPeer);
const localPeerResponse = responses?.find(
response => response.peer?.peerid === localPeerID
response =>
response.peer?.peerid === localPeer?.id ||
response.peer?.userid === localPeer?.customerUserId
);
const isLocalPeerCreator = localPeerID === startedBy;
const isLocalPeerCreator = localPeer?.id === startedBy;
const localPeerRoleName = useHMSStore(selectLocalPeerRoleName);
const roleCanViewResponse =
!rolesThatCanViewResponses ||
Expand Down
7 changes: 5 additions & 2 deletions src/components/Polls/Voting/TimedVoting.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ import { QuestionCard } from "./QuestionCard";
* @returns
*/
export const TimedView = ({ poll }) => {
const [currentIndex, setCurrentIndex] = useState(0);
const activeQuestion = poll.questions?.[currentIndex];
// backend question index starts at 1
const [currentIndex, setCurrentIndex] = useState(1);
const activeQuestion = poll.questions?.find(
question => question.index === currentIndex
);
if (!activeQuestion) {
return null;
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Polls/Voting/Voting.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const Voting = ({ id, toggleVoting }) => {
borderBottom: "1px solid $border_default",
}}
>
<Text variant="h6">{poll?.type?.toUpperCase()}</Text>
<Text variant="h6">{poll.title}</Text>
<StatusIndicator
isLive={isLive}
shouldShowTimer={isLive && isTimed}
Expand Down
4 changes: 2 additions & 2 deletions src/components/Preview/PreviewJoin.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ const Container = styled("div", {
px: "$10",
});

const PreviewTile = ({ name, error }) => {
export const PreviewTile = ({ name, error }) => {
const localPeer = useHMSStore(selectLocalPeer);
const borderAudioRef = useBorderAudioLevel(localPeer?.audioTrack);
const isVideoOn = useHMSStore(selectIsLocalVideoEnabled);
Expand Down Expand Up @@ -199,7 +199,7 @@ const PreviewTile = ({ name, error }) => {
);
};

const PreviewControls = () => {
export const PreviewControls = () => {
return (
<Flex
justify="between"
Expand Down
48 changes: 42 additions & 6 deletions src/components/RoleChangeRequestModal.jsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,64 @@
import React from "react";
import React, { useEffect } from "react";
import {
selectLocalPeerName,
selectRoleChangeRequest,
useHMSActions,
useHMSStore,
} from "@100mslive/react-sdk";
import { Flex, Text } from "@100mslive/roomkit-react";
import { PreviewControls, PreviewTile } from "./Preview/PreviewJoin";
import { RequestDialog } from "../primitives/DialogContent";
import { useIsHeadless } from "./AppData/useUISettings";

export const RoleChangeRequestModal = () => {
const hmsActions = useHMSActions();
const isHeadless = useIsHeadless();
const roleChangeRequest = useHMSStore(selectRoleChangeRequest);
const name = useHMSStore(selectLocalPeerName);

useEffect(() => {
if (!roleChangeRequest?.role || isHeadless) {
return;
}

hmsActions.preview({ asRole: roleChangeRequest.role.name });
}, [hmsActions, roleChangeRequest, isHeadless]);

if (!roleChangeRequest?.role || isHeadless) {
return null;
}

const body = (
<>
<Text
css={{ fontWeight: 400, c: "$on_surface_medium", textAlign: "center" }}
>
Setup your audio and video before joining
</Text>
<Flex
align="center"
justify="center"
css={{
"@sm": { width: "100%" },
flexDirection: "column",
}}
>
<PreviewTile name={name} />
<PreviewControls />
</Flex>
</>
);

return (
<RequestDialog
title="Role Change Request"
onOpenChange={value =>
!value && hmsActions.rejectChangeRole(roleChangeRequest)
}
body={`${roleChangeRequest?.requestedBy?.name} has requested you to change your role to ${roleChangeRequest?.role?.name}.`}
title={`You're invited to join the ${roleChangeRequest.role.name} role`}
onOpenChange={async value => {
if (!value) {
await hmsActions.rejectChangeRole(roleChangeRequest);
await hmsActions.cancelMidCallPreview();
}
}}
body={body}
onAction={() => {
hmsActions.acceptChangeRole(roleChangeRequest);
}}
Expand Down
3 changes: 2 additions & 1 deletion src/components/Streaming/Common.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,15 @@ export const ContentHeader = ({ onBack, onClose, title = "", content }) => {
bg: "$surface_bright",
r: "$round",
alignSelf: "center",
mr: "$8",
}}
onClick={onBack}
data-testid="go_back"
>
<ChevronLeftIcon width={16} height={16} />
</Text>
) : null}
<Box css={{ flex: "1 1 0", mx: "$8" }}>
<Box css={{ flex: "1 1 0" }}>
{title ? (
<Text
variant="tiny"
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/whiteboard/PusherCommunicationProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class PusherCommunicationProvider {

/** @private */
this.pusher = new Pusher(process.env.REACT_APP_PUSHER_APP_KEY, {
cluster: "ap2",
cluster: process.env.REACT_APP_PUSHER_CLUSTER || "ap2",
authEndpoint: process.env.REACT_APP_PUSHER_AUTHENDPOINT,
});

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/whiteboard/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ APP_ID="app_id"
## Whiteboard Client

- Copy the whole folder at `/src/plugins/whiteboard` into your live video conferencing apps using 100ms' SDKs.
- Add the pusher app key and pusher auth endpoint to `REACT_APP_PUSHER_APP_KEY` and `REACT_APP_PUSHER_AUTHENDPOINT` environment variables.
- Add the pusher app key, auth endpoint and cluster to `REACT_APP_PUSHER_APP_KEY`, `REACT_APP_PUSHER_AUTHENDPOINT`, `REACT_APP_PUSHER_CLUSTER` environment variables.
- The `useWhiteboardMetadata` hook returns state such as the whiteboard owner(`whiteboardOwner`) and action to toggle the whiteboard(`toggleWhiteboard`). Refer usage in `ToggleWhiteboard.jsx` - an icon button to toggle the whiteboard based on the active state.
- When the whiteboard is active(`whiteboardOwner` from `useWhiteboardMetadata` is not null), render the `Whiteboard` component on your UI to let your users draw on the whiteboard. Refer `mainView.jsx` and `WhiteboardView.jsx`.
26 changes: 15 additions & 11 deletions src/primitives/DialogContent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,21 @@ export const RequestDialog = ({
{Icon ? Icon : null}
<Text variant="h6">{title}</Text>
</Dialog.Title>
<Text
variant="md"
css={{
fontWeight: 400,
mt: "$4",
mb: "$10",
c: "$on_surface_medium",
}}
>
{body}
</Text>
{typeof body === "string" ? (
<Text
variant="md"
css={{
mt: "$4",
mb: "$10",
fontWeight: 400,
c: "$on_surface_medium",
}}
>
{body}
</Text>
) : (
<Box css={{ mt: "$4", mb: "$10" }}>{body}</Box>
)}
<Flex
justify="center"
align="center"
Expand Down
Loading
Loading