@cloudflare/realtimekit-angular-ui v1.0.1
RealtimeKit UI
RealtimeKit UI provides pre-built, ready-to-use UI components for integrating with Cloudflare RealtimeKit.
If you're using a specific framework (or no framework - see HTML), we also offer dedicated packages:
Usage
First, install RealtimeKit UI along with RealtimeKit:
@cloudflare/realtimekitis the core package that offers APIs to handle meetings in the client side. You use it to access and perform actions in a meeting.
npm i @cloudflare/realtimekit-ui @cloudflare/realtimekitThen you'll need to initialize a meeting object once you've received an authToken of a participant from your APIs.
You call the RealtimeKit Add Participant API from your own backend API to get this
authTokento use with RealtimeKit.
import RealtimeKitClient from '@cloudflare/realtimekit';
const meeting = await RealtimeKitClient.init({
authToken: '<your-auth-token>',
defaults: {
video: true,
audio: true,
},
});Simple Usage
Load the component in your template file (component.html):
<rtk-meeting #myid></rtk-meeting>Then initialize and pass the meeting object to the component:
import { RtkMeeting } from '@cloudflare/realtimekit-ui';
import RealtimeKitClient from '@cloudflare/realtimekit';
class AppComponent {
title = 'MyProject';
@ViewChild('myid') meetingComponent: RtkMeeting;
rtkMeeting: RtkClient;
async ngAfterViewInit() {
const meeting = await RealtimeKitClient.init({
authToken: '<auth-token>',
defaults: {
video: true,
audio: true,
},
});
meeting.joinRoom();
this.rtkMeeting = meeting;
if (this.meetingComponent) this.meetingComponent.meeting = meeting;
}
}Using RtkUiProvider
If you wish to use individual UI components to build your desired UI, you can use the RtkUiProvider component to provide the meeting instance to all child components to make development easier.
<rtk-ui-provider #myid>
<rtk-simple-grid />
</rtk-ui-provider>Then initialize and pass the meeting object to the component:
import { RtkMeeting } from '@cloudflare/realtimekit-ui';
import RealtimeKitClient from '@cloudflare/realtimekit';
class AppComponent {
title = 'MyProject';
@ViewChild('myid') uiProvider: RtkUiProvider;
rtkMeeting: RtkClient;
async ngAfterViewInit() {
const meeting = await RealtimeKitClient.init({
authToken: '<auth-token>',
defaults: {
video: true,
audio: true,
},
});
meeting.joinRoom();
this.rtkMeeting = meeting;
if (this.uiProvider) this.uiProvider.meeting = meeting;
}
}10 months ago
10 months ago
10 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
12 months ago
12 months ago
12 months ago
12 months ago