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.
Input parameters for the component.
API credentials for MediaSFU.
Optional
returnUIOptional
noUIPreOptional
createOptional
joinFlag to toggle between create and join modes.
Form group for pre-join form.
Error message to display.
Fileoverview
PreJoinPage component for handling room creation and joining on MediaSFU.
Component
Selector
app-pre-join-page
Standalone
true
Template Url
./pre-join-page.component.html
Style Urls
./pre-join-page.component.css
Imports
[CommonModule, ReactiveFormsModule]
Description
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.
Param: fb
FormBuilder service for creating form groups.
Param: http
HttpClient service for making HTTP requests.
Param: cookieService
CookieService for managing cookies.
Method
ngOnInit
Description
Lifecycle hook that is called after data-bound properties are initialized.
Method
toggleMode
Description
Toggles between create and join modes and resets the error message.
Method
handleCreateRoom
Description
Handles the creation of a room on MediaSFU. Validates form inputs, sends a request to create a room, and handles the response.
Method
handleJoinRoom
Description
Handles joining a room on MediaSFU. Validates form inputs, sends a request to join a room, and handles the response.
Method
checkLimitsAndMakeRequest
Description
Checks rate limits and makes a request to connect to a room. Handles unsuccessful attempts and updates the state accordingly.
Method
createRoomOnMediaSFU
Description
Sends a request to create a room on MediaSFU.
Param: params
Parameters for the request.
Param: params.payload
Payload for the request.
Param: params.apiUserName
API username.
Param: params.apiKey
API key.
Returns
Response from the API.
Method
joinRoomOnMediaSFU
Description
Sends a request to join a room on MediaSFU.
Param: params
Parameters for the request.
Param: params.payload
Payload for the request.
Param: params.apiUserName
API username.
Param: params.apiKey
API key.
Returns
Response from the API.
Example