An override is a setting that your app passes to the UI Kit. The UI Kit uses your value instead of the value that it normally uses.
Normally, two things control what a participant sees in the UI Kit and how the UI Kit works:
- The preset: You create the preset on the server and assign it to a participant. For example, the preset decides whether the participant can use private chat.
- The UI Kit defaults: The UI Kit chooses these values automatically. For example, the UI Kit shows an emoji picker in the chat.
An override changes one of these values from your app code. For example, an override can hide the emoji picker.
Use a preset when the same setting applies to every participant with the same role. Use an override when you want to change how your app looks, or when the change is for some meetings only.
For example, some meetings are formal, such as a meeting with a lawyer or a doctor. Your app can pass an override that hides the emoji picker in the chat for these meetings only. The preset does not change.
An override has a limited effect:
- It changes how the UI Kit works. It does not change the permissions of the participant.
- It works only in the app that sets it. One override is different:
disableScreenshareVisibilityTrackingalso changes the viewing status that other participants see. - You set it in your app code. It does not change the preset.
Most apps do not need overrides. If you are not sure that you need an override, do not use it.
The following table lists the overrides that the UI Kit supports:
| Override | Area | Type | Description |
|---|---|---|---|
disableEmojiPicker |
Chat | boolean |
Hides the emoji picker button in the chat message box. |
disablePrivateChat |
Chat | boolean |
Hides private chat, even when the preset allows it. |
disableScreenshareVisibilityTracking |
Screen share | boolean |
Turns off the screen share viewing status. |
hideMediaSelectorsInSetupScreen |
Setup screen | boolean |
Hides the microphone, camera, and speaker selectors. |
Every override is optional. The default value of every override is false. The overrides object has the following type:
interface Overrides {
disableEmojiPicker?: boolean;
disablePrivateChat?: boolean;
disableScreenshareVisibilityTracking?: boolean;
hideMediaSelectorsInSetupScreen?: boolean;
}Put all overrides in one object named overrides. Each override is one key in this object. To use more than one override, add each override as a separate key.
You do not need to set the overrides on each component. Set the overrides one time on the top-level component. The top-level component passes the overrides to every UI Kit component inside it.
Set the overrides property of the rtk-meeting element to the object. Because the value is an object, you must set it in JavaScript. You cannot set it as an HTML attribute.
<rtk-meeting id="my-meeting"></rtk-meeting>
<script>
const meetingElement = document.getElementById("my-meeting");
meetingElement.overrides = {
disableEmojiPicker: true,
hideMediaSelectorsInSetupScreen: true,
};
meetingElement.showSetupScreen = true;
meetingElement.meeting = meeting;
</script>Pass the object to the overrides prop of the RtkMeeting component.
import { useRealtimeKitMeeting } from "@cloudflare/realtimekit-react";
import { RtkMeeting } from "@cloudflare/realtimekit-react-ui";
const overrides = {
disableEmojiPicker: true,
hideMediaSelectorsInSetupScreen: true,
};
export default function MyMeetingUI() {
const { meeting } = useRealtimeKitMeeting();
return (
<RtkMeeting
meeting={meeting}
showSetupScreen={true}
overrides={overrides}
/>
);
}Bind the object to the overrides input of the rtk-meeting component.
<rtk-meeting
[meeting]="meeting"
[showSetupScreen]="true"
[overrides]="overrides"
></rtk-meeting>import { Component } from "@angular/core";
import type RealtimeKitClient from "@cloudflare/realtimekit";
import type { Overrides } from "@cloudflare/realtimekit-angular-ui";
@Component({
selector: "app-meeting",
templateUrl: "./meeting.component.html",
})
export class MeetingComponent {
meeting: RealtimeKitClient;
overrides: Overrides = {
disableEmojiPicker: true,
hideMediaSelectorsInSetupScreen: true,
};
}If you build your own UI, set the overrides property of the rtk-ui-provider element to the object. Then every UI Kit component inside rtk-ui-provider uses the overrides.
<rtk-ui-provider id="rtk-ui-provider">
<rtk-setup-screen></rtk-setup-screen>
</rtk-ui-provider>
<script>
const provider = document.getElementById("rtk-ui-provider");
provider.overrides = {
disablePrivateChat: true,
hideMediaSelectorsInSetupScreen: true,
};
provider.meeting = meeting;
</script>If you build your own UI, pass the object to the overrides prop of the RtkUiProvider component. Then every UI Kit component inside RtkUiProvider uses the overrides.
import { useRealtimeKitMeeting } from "@cloudflare/realtimekit-react";
import {
RtkSetupScreen,
RtkUiProvider,
} from "@cloudflare/realtimekit-react-ui";
const overrides = {
disablePrivateChat: true,
hideMediaSelectorsInSetupScreen: true,
};
export default function MyCustomUI() {
const { meeting } = useRealtimeKitMeeting();
return (
<RtkUiProvider meeting={meeting} overrides={overrides}>
<RtkSetupScreen />
</RtkUiProvider>
);
}If you build your own UI, bind the object to the overrides input of the rtk-ui-provider component. Then every UI Kit component inside rtk-ui-provider uses the overrides.
<rtk-ui-provider [meeting]="meeting" [overrides]="overrides">
<rtk-setup-screen></rtk-setup-screen>
</rtk-ui-provider>import { Component } from "@angular/core";
import type RealtimeKitClient from "@cloudflare/realtimekit";
import type { Overrides } from "@cloudflare/realtimekit-angular-ui";
@Component({
selector: "app-custom-meeting",
templateUrl: "./custom-meeting.component.html",
})
export class CustomMeetingComponent {
meeting: RealtimeKitClient;
overrides: Overrides = {
disablePrivateChat: true,
hideMediaSelectorsInSetupScreen: true,
};
}You can change the overrides during a meeting. To do this, pass a new object.
Do not change the object that you passed before. The UI Kit detects a change only when it receives a new object.
const meetingElement = document.getElementById("my-meeting");
meetingElement.overrides = {
...meetingElement.overrides,
disableEmojiPicker: false,
};Store the object in React state. To change the overrides, set a new object:
import { useState } from "react";
import { useRealtimeKitMeeting } from "@cloudflare/realtimekit-react";
import { RtkMeeting } from "@cloudflare/realtimekit-react-ui";
export default function MyMeetingUI() {
const { meeting } = useRealtimeKitMeeting();
const [overrides, setOverrides] = useState({ disableEmojiPicker: true });
const showEmojiPicker = () => {
setOverrides((current) => ({ ...current, disableEmojiPicker: false }));
};
return (
<>
<button onClick={showEmojiPicker}>Show emoji picker</button>
<RtkMeeting meeting={meeting} overrides={overrides} />
</>
);
}Set a new object on the component property that is bound to the overrides input:
showEmojiPicker() {
this.overrides = {
...this.overrides,
disableEmojiPicker: false,
};
}Use disableEmojiPicker to hide the emoji picker button in the chat message box.
The chat message box has a button that opens an emoji picker. If you set this override to true, the UI Kit does not show this button. Participants can still type emojis with the keyboard.
Use this override for formal meetings where you do not want an emoji picker.
const overrides = {
disableEmojiPicker: true,
};Use disablePrivateChat to hide private chat, even if the participant's preset allows private chat.
In the chat panel, a participant can use the public chat, or a private chat with one other participant. The UI Kit shows private chat if the participant's preset allows private messages. If you set this override to true, the participant sees only the public chat.
This override only hides the private chat UI in your app. It does not change the permissions in the preset. To turn off private chat for every participant with a role, change the chat permissions in the preset of that role.
const overrides = {
disablePrivateChat: true,
};Use disableScreenshareVisibilityTracking to turn off the screen share viewing status.
When a participant shares a screen, the UI Kit shows this participant whether the other participants are viewing the shared screen. This is the viewing status:
- A red border means that no participant is viewing the shared screen.
- A green border means that all participants are viewing the shared screen.
- If only some participants are viewing the shared screen, the UI Kit shows the participants who are not viewing it.
If you set this override to true, two things change in your app:
- When the local user shares a screen, the local user does not see the viewing status.
- When another participant shares a screen, your app does not tell that participant whether the local user is viewing the shared screen.
Earlier versions of the UI Kit do not send the viewing status. A participant with an earlier version always appears as a participant who is not viewing the shared screen. Use this override until all participants in your meetings use a UI Kit version that sends the viewing status.
const overrides = {
disableScreenshareVisibilityTracking: true,
};Use hideMediaSelectorsInSetupScreen to hide the microphone, camera, and speaker selectors on the setup screen.
A participant sees the setup screen before the participant joins the meeting. The setup screen shows a preview of the camera video. It also shows three selectors: one for the microphone, one for the camera, and one for the speaker. If you set this override to true, the UI Kit does not show the three selectors. The UI Kit still shows the preview.
Use this override when you want a simpler setup screen, or when you do not want participants to choose devices before they join.
const overrides = {
hideMediaSelectorsInSetupScreen: true,
};