Web (external)
The Conference class allows you to embed a conferencing iframe into your web application. It requires a Client instance and supports customizable options for microphone, camera, and other settings. This guide explains how to integrate the Conference class from the datagram-network/conference-sdk into your project to enable video conferencing features.
Class: Conference
Constructor
constructor(client: Client | null, options: IConferenceOptions = {})client: This is an instance of the Client class that connects you to the Datagram network.
options: These are optional settings you can use to customize the conference.
1. Types
IConferenceOptions
type IConferenceOptions = {
metadata?: {
title?: string; // You can set a title for the conference (optional)
};
skipMediaSettings?: boolean; // If true, it skips asking for microphone/camera permissions at the start
turnOnMic?: boolean; // Automatically turns on microphone if true
turnOnCam?: boolean; // Automatically turns on camera if true
authorization?: string; // Your authorization token for accessing the conference
};2. Methods
Mounts the conference iframe into the specified DOM element.
selector: A CSS selector (e.g., #datagram-frame) or an HTMLElement.
Returns: A Promise that resolves when the iframe is mounted.
Cleans up all components created by the mount method, removing the iframe and associated resources.
3. Events
The Conference class emits the following events via the browser’s message event listener:
call_ended: Triggered when the user clicks the "End Call" button.
invalid_qr_code: Fired if an incorrect or expired alias is provided, redirecting to an invalid code screen.
conference-ready: Indicates the iframe’s source has loaded. Possible screens: media_testing, conference, invalid, call_ended, or not_supported.
call-ready: Fired when the conference screen is active (occurs after conference-ready).
Tip: Use an event listener to handle these events (see example below).
4. Getting Started Example
Here is a basic example of how to create a client and conference, and then mount it on the page:
5. Vue.js Example
This example demonstrates how to integrate the Conference class into a Vue 3 application using TypeScript and the Composition API.
Template
Script
Styles
Last updated
