Skip to content

Commit

Permalink
Refactor rtc-server to separate directory (#23)
Browse files Browse the repository at this point in the history
* Refactor rtc-server to separate directory

* Fix adding clients for mediasoup and displaying speaker

* Remove redisClientId from event parameters

This change removes redisClientId from params of all socket events.
Now, rtc-server stores in memory mapping of rtcSocketId to redisClientId.

* Remove dependencies and address lint errors

* Fix declined client notitification

Co-authored-by: Gary C <[email protected]>
  • Loading branch information
williamtnguyen and 1234momo authored May 3, 2021
1 parent e3de679 commit 88e8390
Show file tree
Hide file tree
Showing 18 changed files with 1,085 additions and 644 deletions.
14 changes: 9 additions & 5 deletions client/src/pages/Landing.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useContext } from 'react';
import { createConnection } from '../utils/socket-client';
import { openSessionSocket } from '../utils/session-socket-client';
import { RouteComponentProps, withRouter } from 'react-router-dom';
import { SocketContext } from '../App';
import CreateSessionForm from '../components/CreateSessionForm';
Expand All @@ -13,10 +13,14 @@ const { TabPane } = Tabs;
const Landing = (props: RouteComponentProps & any) => {
const { setClientId, setClientDisplayName } = useContext(SocketContext);

const startSession = async (
{ displayName, roomType }: { displayName: string, roomType: string }
) => {
const newSocket = await createConnection(displayName, roomType, true);
const startSession = async ({
displayName,
roomType,
}: {
displayName: string;
roomType: string;
}) => {
const newSocket = await openSessionSocket(displayName, roomType, true);

setClientId(newSocket.id);
setClientDisplayName(displayName);
Expand Down
Loading

0 comments on commit 88e8390

Please sign in to comment.