Utility functions
buildVideoElement
- buildVideoElement(
options):Promise<BuildVideoElementReturnType>
A function that creates and optionally injects a video DOM element for a given Call or Room object.
If you have passed a rootElement when instantiating the SignalWire client, or
when dialing a call, the SDK will manage the DOM automatically; injecting the resulting video stream
into the rootElement that you specified.
But for more fine grained control, or if you’re using a library like React, you can choose to
manually manage DOM using this function. Be sure to not specify a rootElement at instantiation or during dialing.
Parameters
Response
Example
After the SignalWire Client has been instantiated, you can dial a video call and inject it into the DOM as follows:
Alternatively, you can pass in the rootElement parameter and let the function automatically manage DOM: