decodeOnce(element, retryIfNotFound = true, retryIfChecksumOrFormatError = true) {
			this._stopAsyncDecode = false;
			const loop = (resolve, reject) => {
				if (this._stopAsyncDecode) {
					reject(new NotFoundException('Video stream has ended before any code could be detected.'));
					this._stopAsyncDecode = undefined;
					return;
				}
				try {
					const result = this.decode(element);
					resolve(result);
				}
				catch (e) {
					const ifNotFound = retryIfNotFound && e instanceof NotFoundException;
					const isChecksumOrFormatError = e instanceof ChecksumException || e instanceof FormatException;
					const ifChecksumOrFormat = isChecksumOrFormatError && retryIfChecksumOrFormatError;
					if (ifNotFound || ifChecksumOrFormat) {
						// trying again
						return setTimeout(loop, this._timeBetweenDecodingAttempts, resolve, reject);
					}
					reject(e);
				}
			};
			return new Promise((resolve, reject) => loop(resolve, reject));
		}
Tries to decode from the video input until it finds some value.