Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
@daily-co/daily-vcs-web
Advanced tools
This package enables developers to render a VCSComposition inside a given DOM element in the browser.
The @daily-co/daily-vcs-web
package enables developers to render a VCSComposition
inside a given DOM element in the browser.
Install the package via npm or yarn:
npm install @daily-co/daily-vcs-web
# or
yarn add @daily-co/daily-vcs-web
Import the DailyVCSWebRender
class from @daily-co/daily-vcs-web
and create an instance to get started:
import DailyIframe from '@daily-co/daily-js';
import DailyVCSBaselineComposition from '@daily-co/vcs-composition-daily-baseline-web';
import DailyVCSWebRenderer from '@daily-co/daily-vcs-web';
const callObject = DailyIframe.createCallObject();
const rootEl = document.getElementById('vcs-wrapper'); // DOM element where the VCS composition will be rendered
const opts = {
callObject: callObject,
viewportSize: { w: 1280, h: 720 },
};
const renderer = new DailyVCSWebRenderer(
callObject,
DailyVCSBaselineComposition,
rootEl,
opts
);
The DailyVCSWebRenderer class provides the following methods:
start()
Starts the VCS composition and renders it to the specified DOM element.
renderer.start();
stop()
Stops the VCS composition and removes it from the DOM.
renderer.stop()
sendParam(paramId, value)
Sends a parameter update to the VCS composition.
renderer.sendParam('paramId', value);
sendParams(params)
Sends a map of parameter updates to the VCS composition.
renderer.sendParams({
paramId1: value1,
paramId2: value2,
...params
});
updateImageSources(images, mergeType)
Updates the image sources of the VCS composition.
renderer.updateImageSources(
{
imageId1: 'imageUrl1',
imageId2: 'imageUrl2',
// ...
},
'replace' // Optional: mergeType, either 'merge' or 'replace' (default is 'replace')
);
updateParticipantIds(participantIds, mergeType)
Updates the participantIds to render.
renderer.updateParticipantIds(
['participantId1', 'participantId2', ...],
'replace' // Optional: mergeType, either 'merge' or 'replace' (default is 'replace')
);
The DailyVCSWebRenderer class also provides several read-only properties:
Name | Type | Description |
---|---|---|
rootElement | DOMElement | The DOM element where the VCS composition is rendered |
vcsApiInstance | VCSApi | The VCSApi instance returned by the VCSComposition. It can be used to send updates to the VCS composition. |
composition | VCSComposition | The VCS composition object. |
participants | string[] | An array of participantIds to render. |
params | Param[] | A map of paramId to value. It keeps track of the current state of the VCS composition. |
size | { w: number, h: number } | The render viewport size used by VCS. |
imageSources | Record<string, string> | A map of image assets. It keeps track of the current image sources |
The DailyVCSWebRenderer class allows you to set optional callbacks that will be triggered during specific events. The available callbacks are:
const opts = {
// ... other options ...
callbacks: {
onStart: () => console.log('VCS composition started.'),
onStop: () => console.log('VCS composition stopped.'),
onError: (e) => console.log('VCS composition error:', e),
onParamsChanged: (params) => console.log('Params changed', params),
}
}
FAQs
This package enables developers to render a VCSComposition inside a given DOM element in the browser.
The npm package @daily-co/daily-vcs-web receives a total of 8 weekly downloads. As such, @daily-co/daily-vcs-web popularity was classified as not popular.
We found that @daily-co/daily-vcs-web demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.