1.0.1 • Published 10 months ago

@cloudflare/realtimekit-angular-ui v1.0.1

Weekly downloads
-
License
-
Repository
-
Last release
10 months ago

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/realtimekit is 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/realtimekit

Then 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 authToken to 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;
  }
}
1.0.1

10 months ago

1.0.0-staging.17

10 months ago

1.0.0-staging.16

10 months ago

1.0.0-staging.15

11 months ago

1.0.0-staging.14

11 months ago

1.0.0-staging.13

11 months ago

1.0.0-staging.12

11 months ago

1.0.0-staging.11

11 months ago

1.0.0-staging.10

11 months ago

1.0.0-staging.9

11 months ago

1.0.0-staging.8

11 months ago

1.0.0-staging.7

11 months ago

1.0.0-staging.6

11 months ago

1.0.0-staging.5

11 months ago

1.0.0-staging.4

12 months ago

1.0.0-staging.3

12 months ago

1.0.0-staging.2

12 months ago

0.0.0

12 months ago