code: function createCameraUI() {
  
          var buttonStyle = "margin: 7px; border: 2.5px solid white; width: 45%; height: 35px; color: white; background-color: black;";
  
          previewContainer = document.createElement('div');
          previewContainer.style.cssText = "background-position: 50% 50%; background-repeat: no-repeat; background-size: contain; background-color: black; left: 0px; top: 0px; width: 100%; height: 100%; position: fixed; z-index: 9999";
          previewContainer.innerHTML =
              '<video id="capturePreview" style="width: 100%; height: 100%"></video>' +
              '<div id="previewButtons" style="width: 100%; bottom: 0px; display: flex; position: absolute; justify-content: space-around; background-color: black;">' +
                  '<button id="takePicture" style="' + buttonStyle + '">Capture</button>' +
                  '<button id="cancelCapture" style="' + buttonStyle + '">Cancel</button>' +
                  '<button id="selectPicture" style="display: none; ' + buttonStyle + '">Accept</button>' +
                  '<button id="retakePicture" style="display: none; ' + buttonStyle + '">Retake</button>' +
              '</div>';
  
          document.body.appendChild(previewContainer);
  
          // Create fullscreen preview
          capturePreview = document.getElementById('capturePreview');
  
          // Create cancel button
          captureCancelButton = document.getElementById('cancelCapture');
  
          capture = new CaptureNS.MediaCapture();
  
          captureSettings = new CaptureNS.MediaCaptureInitializationSettings();
          captureSettings.streamingCaptureMode = CaptureNS.StreamingCaptureMode.audioAndVideo;
      }
docs: Creates basic camera UI with preview 'video' element and 'Cancel' button
  Capture starts, when you clicking on preview.