PreJoinPage component allows users to either create a new room or join an existing one.
import React from 'react';import { PreJoinPage } from 'mediasfu-reactjs';import { JoinLocalRoomOptions } from 'mediasfu-reactjs';const App = () => { const showAlertFunction = (message: string) => console.log(message); const updateLoadingFunction = (visible: boolean) => console.log(`Loading: ${visible}`); const connectSocketFunction = () => {}; // Connect socket function const updateSocketFunction = (socket: Socket) => {}; // Update socket function const updateValidatedFunction = (validated: boolean) => {}; // Update validated function const updateApiUserNameFunction = (userName: string) => {}; // Update API username function const updateApiTokenFunction = (token: string) => {}; // Update API token function const updateLinkFunction = (link: string) => {}; // Update link function const updateRoomNameFunction = (roomName: string) => {}; // Update room name function const updateMemberFunction = (member: string) => {}; // Update member function return ( <PreJoinPage parameters={{ showAlert: showAlertFunction, updateIsLoadingModalVisible: updateLoadingFunction, connectSocket: connectSocketFunction, updateSocket: updateSocketFunction, updateValidated: updateValidatedFunction, updateApiUserName: updateApiUserNameFunction, updateApiToken: updateApiTokenFunction, updateLink: updateLinkFunction, updateRoomName: updateRoomNameFunction, updateMember: updateMemberFunction, imgSrc: "https://example.com/logo.png" }} credentials={{ apiUserName: "user123", apiKey: "apikey123" }} returnUI={true} noUIPreJoinOptions={{ action: "create", capacity: 10, duration: 15, eventType: "broadcast", userName: "Prince", }} connectMediaSFU={true} localLink="http://localhost:3000" /> );};export default App; Copy
import React from 'react';import { PreJoinPage } from 'mediasfu-reactjs';import { JoinLocalRoomOptions } from 'mediasfu-reactjs';const App = () => { const showAlertFunction = (message: string) => console.log(message); const updateLoadingFunction = (visible: boolean) => console.log(`Loading: ${visible}`); const connectSocketFunction = () => {}; // Connect socket function const updateSocketFunction = (socket: Socket) => {}; // Update socket function const updateValidatedFunction = (validated: boolean) => {}; // Update validated function const updateApiUserNameFunction = (userName: string) => {}; // Update API username function const updateApiTokenFunction = (token: string) => {}; // Update API token function const updateLinkFunction = (link: string) => {}; // Update link function const updateRoomNameFunction = (roomName: string) => {}; // Update room name function const updateMemberFunction = (member: string) => {}; // Update member function return ( <PreJoinPage parameters={{ showAlert: showAlertFunction, updateIsLoadingModalVisible: updateLoadingFunction, connectSocket: connectSocketFunction, updateSocket: updateSocketFunction, updateValidated: updateValidatedFunction, updateApiUserName: updateApiUserNameFunction, updateApiToken: updateApiTokenFunction, updateLink: updateLinkFunction, updateRoomName: updateRoomNameFunction, updateMember: updateMemberFunction, imgSrc: "https://example.com/logo.png" }} credentials={{ apiUserName: "user123", apiKey: "apikey123" }} returnUI={true} noUIPreJoinOptions={{ action: "create", capacity: 10, duration: 15, eventType: "broadcast", userName: "Prince", }} connectMediaSFU={true} localLink="http://localhost:3000" /> );};export default App;
The properties for the PreJoinPage component.
The rendered PreJoinPage component.
Optional
Ignored by React.
Only kept in types for backwards compatibility. Will be removed in a future major release.
Used in debugging messages. You might want to set it explicitly if you want to display a different name for debugging purposes.
Legacy React Docs
const MyComponent: FC = () => { return <div>Hello!</div>}MyComponent.displayName = 'MyAwesomeComponent' Copy
const MyComponent: FC = () => { return <div>Hello!</div>}MyComponent.displayName = 'MyAwesomeComponent'
PreJoinPage component allows users to either create a new room or join an existing one.
Component
Example