message: new continuoues decode browser API
diff: @@ -273,10 +273,23 @@ export class BrowserCodeReader {
  * @returns {Promise<void>}
  *
  * @memberOf BrowserCodeReader
  + *
  + * @deprecated Use `decodeFromVideoDevice` instead.
  */
  public async decodeFromInputVideoDeviceContinuously(deviceId: string | null, videoSource: string | HTMLVideoElement | null, callbackFn: DecodeContinuouslyCallback): Promise<void> {
  + return await this.decodeFromVideoDevice(deviceId, videoSource, callbackFn);
  + }
  - this.reset();
  + /**
  + * Continuously tries to decode the barcode from the device specified by device while showing the video in the specified video element.
  + *
  + * @param {string|null} [deviceId] the id of one of the devices obtained after calling getVideoInputDevices. Can be undefined, in this case it will decode from one of the available devices, preffering the main camera (environment facing) if available.
  + * @param {string|HTMLVideoElement|null} [video] the video element in page where to show the video while decoding. Can be either an element id or directly an HTMLVideoElement. Can be undefined, in which case no video will be shown.
  + * @returns {Promise<void>}
  + *
  + * @memberOf BrowserCodeReader
  + */
  + public async decodeFromVideoDevice(deviceId: string | null, videoSource: string | HTMLVideoElement | null, callbackFn: DecodeContinuouslyCallback): Promise<void> {
  let videoConstraints: MediaTrackConstraints;
  @@ -288,10 +301,41 @@ export class BrowserCodeReader {
  const constraints: MediaStreamConstraints = { video: videoConstraints };
  + return await this.decodeFromConstraints(constraints, videoSource, callbackFn);
  + }
  +
  + /**
  + * Continuously tries to decode the barcode from a stream obtained from the given constraints while showing the video in the specified video element.
  + *
  + * @param {MediaStream} [constraints] the media stream constraints to get s valid media stream to decode from
  + * @param {string|HTMLVideoElement} [video] the video element in page where to show the video while decoding. Can be either an element id or directly an HTMLVideoElement. Can be undefined, in which case no video will be shown.
  + * @returns {Promise<Result>} The decoding result.
  + *
  + * @memberOf BrowserCodeReader
  + */
  + private async decodeFromConstraints(constraints: MediaStreamConstraints, videoSource: string | HTMLVideoElement, callbackFn: DecodeContinuouslyCallback): Promise<void> {
  +
  const stream = await navigator.mediaDevices.getUserMedia(constraints);
  +
  + return await this.decodeFromStream(stream, videoSource, callbackFn);
  + }
  +
  + /**
  + * In one attempt, tries to decode the barcode from a stream obtained from the given constraints while showing the video in the specified video element.
  + *
  + * @param {MediaStream} [constraints] the media stream constraints to get s valid media stream to decode from
  + * @param {string|HTMLVideoElement} [video] the video element in page where to show the video while decoding. Can be either an element id or directly an HTMLVideoElement. Can be undefined, in which case no video will be shown.
  + * @returns {Promise<Result>} The decoding result.
  + *
  + * @memberOf BrowserCodeReader
  + */
  + private async decodeFromStream(stream: MediaStream, videoSource: string | HTMLVideoElement, callbackFn: DecodeContinuouslyCallback) {
  +
  + this.reset();
  +
  const video = await this.attachStreamToVideo(stream, videoSource);
  - this.decodeContinuously(video, callbackFn);
  + return await this.decodeContinuously(video, callbackFn);
  }
  /**
  