mediasfu-angular
Version:
mediasfu-angular - Angular 17/18/19 WebRTC SDK for video conferencing, webinars, broadcasts, live streaming, chat, recording, whiteboard, and AI agents. Prebuilt rooms and fully custom UIs.
49 lines (48 loc) • 2.13 kB
TypeScript
import { Socket } from 'socket.io-client';
import * as i0 from "@angular/core";
export interface JoinRoomClientOptions {
socket: Socket;
roomName: string;
islevel: string;
member: string;
sec: string;
apiUserName: string;
consume?: boolean;
}
export type JoinRoomClientType = (params: JoinRoomClientOptions) => Promise<any>;
/**
* Facilitates joining a room by emitting the `joinRoom` event to the server through a socket connection.
*
* @param {JoinRoomClientOptions} options - Configuration options for joining the room.
* @param {Socket} options.socket - The socket instance for server communication.
* @param {string} options.roomName - The name of the room to join.
* @param {string} options.islevel - Level identifier for the user in the room.
* @param {string} options.member - Member identifier for the joining user.
* @param {string} options.sec - Security token or identifier for access.
* @param {string} options.apiUserName - API username for server authentication.
* @param {boolean} [options.consume=false] - If `true`, joins via `joinConRoom`; otherwise, joins via `joinRoom`.
* @returns {Promise<any>} - A promise resolving with the server response data.
* @throws {Error} - Throws an error if the room joining attempt fails.
*
* @example
* ```typescript
* const joinRoomClient = new JoinRoomClient(joinRoomService, joinConRoomService);
* const response = await joinRoomClient.joinRoomClient({
* socket: mySocket,
* roomName: 'myRoom',
* islevel: '1',
* member: 'user123',
* sec: 'secureToken',
* apiUserName: 'apiUser',
* consume: true,
* });
* console.log('Joined room with response:', response);
* ```
*
* This example demonstrates using `joinRoomClient` to join a room, either as a consumer or a producer, based on the `consume` flag.
*/
export declare class JoinRoomClient {
joinRoomClient({ socket, roomName, islevel, member, sec, apiUserName, consume, }: JoinRoomClientOptions): Promise<any>;
static ɵfac: i0.ɵɵFactoryDeclaration<JoinRoomClient, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<JoinRoomClient>;
}