Skip to content

Commit

Permalink
Adapt to backend changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jeevcat committed Sep 13, 2022
1 parent 6d01ee1 commit 9643ebb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
16 changes: 8 additions & 8 deletions packages/app/src/components/CreateCall.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import CallAccept from '@mui/icons-material/Call';
import MicOff from '@mui/icons-material/MicOff';
import VideoCall from '@mui/icons-material/VideoCall';
import CameraOff from '@mui/icons-material/VideocamOff';
import {
Avatar,
Button,
Expand All @@ -10,11 +14,6 @@ import {
ListItemText,
ListSubheader,
} from '@mui/material';
import React, { useCallback, useEffect, useState } from 'react';
import CallAccept from '@mui/icons-material/Call';
import VideoCall from '@mui/icons-material/VideoCall';
import MicOff from '@mui/icons-material/MicOff';
import CameraOff from '@mui/icons-material/VideocamOff';
import {
AudioMuted,
AudioUnmuted,
Expand All @@ -24,6 +23,7 @@ import {
VideoStopped,
} from '@stream-io/video-client';
import { useStreamVideoClient } from '@stream-io/video-components-react';
import React, { useCallback, useEffect, useState } from 'react';
import type { Participants } from '../App';

export const CreateCall = (props: {
Expand Down Expand Up @@ -81,16 +81,16 @@ export const CreateCall = (props: {
const initiateCall = useCallback(
async (id: string) => {
try {
await client?.createCall({
await client?.createRoom({
id,
type: 'video',
participantIds: selectedParticipants,
// participantIds: selectedParticipants,
});
} catch (err) {
console.error(`Failed to create a call`, err);
}
},
[client, selectedParticipants],
[client],
);

useEffect(() => {
Expand Down
10 changes: 5 additions & 5 deletions packages/client/src/StreamVideoClient.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Latency } from './gen/video/coordinator/broadcast_v1/broadcast';
import { Call } from './gen/video/coordinator/call_v1/call';
import {
CreateCallRequest,
CreateRoomRequest,
JoinCallRequest,
ReportCallStatsRequest,
ReportCallStatsResponse,
Expand Down Expand Up @@ -75,10 +75,10 @@ export class StreamVideoClient {
this.ws?.keepAlive.setPayload(payload);
};

createCall = async (data: CreateCallRequest) => {
const callToCreate = await this.client.createCall(data);
const { call } = callToCreate.response;
return call;
createRoom = async (data: CreateRoomRequest) => {
const callToCreate = await this.client.createRoom(data);
const { room } = callToCreate.response;
return room;
};

joinCall = async (data: JoinCallRequest) => {
Expand Down

0 comments on commit 9643ebb

Please sign in to comment.