mediasfu-reactnative-expo
Version:
mediasfu-reactnative-expo – Expo-managed React Native WebRTC SDK for video conferencing, webinars, live streaming, broadcast, screen sharing, whiteboard, chat, recording, live subtitles, translation, and AI agent rooms on iOS, Android, and web. Prebuilt r
47 lines • 1.73 kB
JavaScript
import { joinRoomClient as sharedJoinRoomClient } from 'mediasfu-shared';
/**
* Joins a room by emitting the `joinRoom` event to the server using the provided socket.
*
* @param {JoinRoomClientOptions} options - The options for joining the room.
* @param {Socket} options.socket - The socket instance to use for communication.
* @param {string} options.roomName - The name of the room to join.
* @param {string} options.islevel - The level indicator for the room.
* @param {string} options.member - The member identifier.
* @param {string} options.sec - The security token or identifier.
* @param {string} options.apiUserName - The API username for authentication.
* @param {boolean} [options.consume=false] - Flag to determine which join function to use.
* @returns {Promise<ResponseJoinRoom | Partial<ResponseJoinRoom>>} A promise that resolves with the data returned from the server.
* @throws {Error} Throws an error if the room joining process fails.
*
* @example
* ```typescript
* 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);
* }
* ```
*/
export const joinRoomClient = async ({ socket, roomName, islevel, member, sec, apiUserName, consume = false, }) => {
return sharedJoinRoomClient({
socket,
roomName,
islevel,
member,
sec,
apiUserName,
consume,
});
};
//# sourceMappingURL=joinRoomClient.js.map