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

Commit

Permalink
remove create from connect method and move to seperate method
Browse files Browse the repository at this point in the history
  • Loading branch information
karkakol authored Apr 3, 2024
1 parent 9c41b1a commit 1654c9b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ const defaultSimulcastConfig = () => ({
let videoSimulcastConfig: SimulcastConfig = defaultSimulcastConfig();
let screencastSimulcastConfig: SimulcastConfig = defaultSimulcastConfig();

export async function initializeWebRTC() {
await MembraneWebRTCModule.create();
}

/**
* The hook used to manage a connection with membrane server.
* @returns An object with functions to manage membrane server connection and `error` if connection failed.
Expand Down Expand Up @@ -156,9 +160,6 @@ export function useWebRTC() {

socket.current = _socket;
webrtcChannel.current = _webrtcChannel;

await MembraneWebRTCModule.create();

await new Promise<void>((resolve, reject) => {
_webrtcChannel
.join()
Expand Down

0 comments on commit 1654c9b

Please sign in to comment.