code: protected void nativePlay(Element video) {
          MediaStream stream = null;
          if (Navigator.getUserMedia != null) {
              stream = Navigator.getUserMedia;
              GWT.log("Uses Default user Media");
          } else if (Navigator.webkitGetUserMedia != null) {
              stream = Navigator.webkitGetUserMedia;
              GWT.log("Uses Webkit User Media");
          } else if (Navigator.mozGetUserMedia != null) {
              stream = Navigator.mozGetUserMedia;
              GWT.log("Uses Moz User Media");
          } else if (Navigator.msGetUserMedia != null) {
              stream = Navigator.msGetUserMedia;
              GWT.log("Uses Microsoft user Media");
          } else {
              GWT.log("No supported media found in your browser");
          }
  
          if (stream != null) {
              Navigator.getMedia = stream;
              Constraints constraints = new Constraints();
              constraints.audio = false;
  
              MediaTrackConstraints mediaTrackConstraints = new MediaTrackConstraints();
              mediaTrackConstraints.width = width;
              mediaTrackConstraints.height = height;
              mediaTrackConstraints.facingMode = facingMode.getName();
              constraints.video = mediaTrackConstraints;
  
              Navigator.mediaDevices.getUserMedia(constraints).then(streamObj -> {
                  mediaStream = (MediaStream) streamObj;
                  if (URL.createObjectURL(mediaStream) != null) {
                      $(video).attr("src", URL.createObjectURL(mediaStream));
                  } else if (WebkitURL.createObjectURL(mediaStream) != null) {
                      $(video).attr("src", WebkitURL.createObjectURL(mediaStream));
                  }
                  if (video instanceof VideoElement) {
                      ((VideoElement) video).play();
                  }
                  onCameraCaptureLoad();
                  return null;
              }).catchException(error -> {
                  GWT.log("MaterialCameraCapture: An error occured! " + error);
                  onCameraCaptureError(error.toString());
                  return null;
              });
          }
      }
docs: Native call to the streams API