MediaSFU React Native
    Preparing search index...

    Function joinRoomClient

    • Joins a room by emitting the joinRoom event to the server using the provided socket.

      Parameters

      • options: JoinRoomClientOptions

        The options for joining the room.

        • socket: Socket
        • roomName: string
        • islevel: string
        • member: string
        • sec: string
        • apiUserName: string
        • Optionalconsume?: boolean

      Returns Promise<any>

      A promise that resolves with the data returned from the server.

      Throws an error if the room joining process fails.

      const options = {
      socket: socketInstance,
      roomName: "room1",
      islevel: "2",
      member: "user123",
      sec: "secureToken",
      apiUserName: "apiUser",
      consume: true
      };

      try {
      const response = await joinRoomClient(options);
      console.log("Joined room successfully:", response);
      } catch (error) {
      console.error("Failed to join room:", error);
      }