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-document-capture hidden></idlive-document-capture>
    <video autoplay></video>
    
  2. Subscribe to the open event and pass srcObject from the html video element to the custom video tag

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