MediaSFU React Native
    Preparing search index...

    Function joinRoom

    • Joins a user to a specified room via a socket connection.

      Parameters

      • options: JoinRoomOptions

        The options for joining the room.

        • socket: Socket
        • roomName: string
        • islevel: string
        • member: string
        • sec: string
        • apiUserName: string

      Returns Promise<object>

      A promise that resolves with the data received from the 'joinRoom' event or rejects with a validation error.

      const options = {
      socket: socketInstance,
      roomName: "s12345678",
      islevel: "1",
      member: "user123",
      sec: "64CharacterLongSecretHere",
      apiUserName: "user123",
      };

      try {
      const response = await joinRoom(options);
      console.log("Room joined:", response);
      } catch (error) {
      console.error("Failed to join room:", error);
      }