Skip to main content
Daily.wrap(iframe, { properties }) Prebuilt Custom Creates a DailyCall instance that controls an iframe element you already have in the DOM. Use wrap() instead of createFrame() when you need full control over the iframe element itself — its attributes, placement, or lifecycle.
Your iframe element must have the allow attribute set to "microphone; camera; autoplay; display-capture" for camera, microphone, and screen sharing to work.
The iframeStyle property cannot be passed to wrap(). Apply styles directly to your iframe element, or use createFrame() if you want Daily to manage the iframe styles.

Parameters

iframe
HTMLIFrameElement
required
The iframe DOM element to attach Daily to. Must have allow="microphone; camera; autoplay; display-capture" set.
properties
DailyCallOptions
Optional configuration. If url is not set here, it must be provided when calling join() or load(). See DailyCallOptions for the full list of options.

Return value

Returns a new DailyCall instance.

Example

const iframe = document.createElement('iframe');
iframe.setAttribute('allow', 'microphone; camera; autoplay; display-capture');
document.body.appendChild(iframe);

const call = Daily.wrap(iframe, {
  url: 'https://your-domain.daily.co/room-name',
});

await call.join();

See also