Class JoinRoomOnMediaSFU

Asynchronously joins a room on MediaSFU.

This method sends a POST request to the MediaSFU API to join an existing room. It validates the provided credentials and dynamically constructs the API endpoint, including support for the Community Edition via a custom localLink.

Configuration options for joining the room.

The payload containing the room details and action (join or create).

The API username, used for authentication.

The API key, used for authentication.

A promise resolving to an object containing the API response:

  • data: The response object, either CreateJoinRoomResponse or CreateJoinRoomError.
  • success: Boolean indicating whether the operation was successful.

Throws an error if the request fails or if the provided credentials are invalid.

const response = await joinRoomOnMediaSFU.joinRoomOnMediaSFU({
payload: {
action: 'join',
meetingID: '123456',
userName: 'user123',
},
apiUserName: 'yourAPIUSERNAME',
apiKey: 'yourAPIKEY',
localLink: 'http://localhost:3000', // Optional for Community Edition
});

if (response.success) {
console.log('Joined room successfully:', response.data);
} else {
console.error('Failed to join room:', response.data?.error);
}

Constructors

Methods

Constructors

Methods

  • Asynchronously joins a room on MediaSFU.

    This method sends a POST request to the MediaSFU API to join an existing room. It validates the provided credentials and dynamically constructs the API endpoint, including support for the Community Edition via a custom localLink.

    Parameters

    • options: {
          payload: CreateMediaSFURoomOptions | JoinMediaSFURoomOptions;
          apiUserName: string;
          apiKey: string;
          localLink?: string;
      }

      Configuration options for joining the room.

      • payload: CreateMediaSFURoomOptions | JoinMediaSFURoomOptions

        The payload containing the room details and action (join or create).

      • apiUserName: string

        The API username, used for authentication.

      • apiKey: string

        The API key, used for authentication.

      • OptionallocalLink?: string

        The local link for Community Edition users. If provided, it overrides the default API URL.

    Returns Promise<{
        data: null | CreateJoinRoomResponse | CreateJoinRoomError;
        success: boolean;
    }>

    A promise resolving to an object containing the API response:

      • data: The response object, either CreateJoinRoomResponse or CreateJoinRoomError.
      • success: Boolean indicating whether the operation was successful.

    Throws an error if the request fails or if the provided credentials are invalid. * *

    * const response = await joinRoomOnMediaSFU.joinRoomOnMediaSFU({
    * payload: {
    * action: 'join',
    * meetingID: '123456',
    * userName: 'user123',
    * },
    * apiUserName: 'yourAPIUSERNAME',
    * apiKey: 'yourAPIKEY',
    * localLink: 'http://localhost:3000', // Optional for Community Edition
    * });
    *
    * if (response.success) {
    * console.log('Joined room successfully:', response.data);
    * } else {
    * console.error('Failed to join room:', response.data?.error);
    * }