Skip to content

Custom Video Tag

By default, the component tag shows video from the camera

It is possible to hide the component and use a custom video tag

  1. Hide the component tag and add a custom video tag

    <idlive-face-capture hidden></idlive-face-capture>
    <video autoplay></video>
    
  2. Subscribe to the open event and pass srcObject from the html video element to the custom video tag

    const idliveFaceCapture = document.querySelector('idlive-face-capture');
    const customVideo = document.querySelector('video');
    
    idliveFaceCapture.addEventListener('open', (event) => {
        const { video } = event.detail[0];
    
        customVideo.srcObject = video.srcObject;
    });