createCallObject()

createCallObject({properties})

Compatibility:
Prebuilt
Custom

Create a video call object as part of the current page's JavaScript environment (not isolated in an iframe).

This is an advanced usage of the daily-js API. It gives you raw access to MediaStreamTrack objects, and other WebRTC objects, for building custom video call experiences.

The argument is an optional properties object that configures call settings. These settings include:

  • url
  • token
  • subscribeToTracksAutomatically
  • reactNativeConfig
  • lang
  • audioSource: Can be set to the MediaStreamTrack object directly, or set to false if you'd rather set the input device later via setInputDevicesAsync()
  • videoSource: See audioSource
  • receiveSettings

For full details on all the properties, see the properties list.

If you don't set at least the url property via createCallObject(), you'll need to set it later when you call the join() or load() method.

Only one call object instance is supported at a time. When re-joining a call, you can either re-use the existing call object instance or be sure to call destroy() on an existing one before creating a new one. Duplicate call object instances will result in a plethora of issues and loud warnings. Starting in daily-js 0.45.0, createCallObject() throws an Error if multiple call object instances are detected.