PreJoinPage component for handling room creation and joining on MediaSFU.

app-pre-join-page

true

./pre-join-page.component.html

./pre-join-page.component.css

[CommonModule, ReactiveFormsModule]

This component provides functionality for users to create or join a room on MediaSFU. It includes form validation, error handling, and API requests to the MediaSFU service.

FormBuilder service for creating form groups.

HttpClient service for making HTTP requests.

CookieService for managing cookies.

ngOnInit

Lifecycle hook that is called after data-bound properties are initialized.

toggleMode

Toggles between create and join modes and resets the error message.

handleCreateRoom

Handles the creation of a room on MediaSFU. Validates form inputs, sends a request to create a room, and handles the response.

handleJoinRoom

Handles joining a room on MediaSFU. Validates form inputs, sends a request to join a room, and handles the response.

checkLimitsAndMakeRequest

Checks rate limits and makes a request to connect to a room. Handles unsuccessful attempts and updates the state accordingly.

createRoomOnMediaSFU

Sends a request to create a room on MediaSFU.

Parameters for the request.

Payload for the request.

API username.

API key.

Response from the API.

joinRoomOnMediaSFU

Sends a request to join a room on MediaSFU.

Parameters for the request.

Payload for the request.

API username.

API key.

Response from the API.

<app-pre-join-page
[parameters]="preJoinPageParameters"
[credentials]="{ apiUserName: 'username', apiKey: 'apiKey' }"
[localLink]="'http://localhost:3000'"
[connectMediaSFU]="false"
></app-pre-join-page>

Implements

  • OnInit

Constructors

Methods

  • A callback method that is invoked immediately after the default change detector has checked the directive's data-bound properties for the first time, and before any of the view or content children have been checked. It is invoked only once when the directive is instantiated.

    Returns void

Properties

parameters: PreJoinPageParameters = ...

Input parameters for the component.

credentials: Credentials = ...

API credentials for MediaSFU.

localLink: undefined | string = ""
connectMediaSFU: undefined | boolean = true
returnUI?: boolean
createMediaSFURoom?: CreateRoomOnMediaSFUType
joinMediaSFURoom?: JoinRoomOnMediaSFUType
isCreateMode: boolean = false

Flag to toggle between create and join modes.

preJoinForm: FormGroup<any>

Form group for pre-join form.

error: string = ''

Error message to display.

imgSrc: string = ...
localConnected: boolean = false
localData: undefined | ResponseLocalConnectionData = undefined
initSocket: undefined | Socket<DefaultEventsMap, DefaultEventsMap> = undefined
pending: BehaviorSubject<boolean> = ...