@needle-tools/engine 4.16.5 → 4.16.7-beta

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -428,6 +428,8 @@ export class VideoPlayer extends Behaviour {
428
428
  }
429
429
  }
430
430
 
431
+ private _playErrors: number = 0;
432
+
431
433
  /** start playing the video source */
432
434
  play() {
433
435
  if (!this._videoElement) this.create(false);
@@ -448,7 +450,8 @@ export class VideoPlayer extends Behaviour {
448
450
  if (debug) console.log("Video Play()", this.clip, this._videoElement, this.time);
449
451
  this._videoElement.currentTime = this.time;
450
452
  this._videoElement.play().catch(err => {
451
- console.log(err);
453
+ if (this._playErrors++ < 10) console.error(err);
454
+ else if (this._playErrors === 10) console.error("Multiple errors playing video, further errors will be suppressed. Use 'debugvideo' param to see all errors.");
452
455
  // https://developer.chrome.com/blog/play-request-was-interrupted/
453
456
  if (debug)
454
457
  console.error("Error playing video", err, "CODE=" + err.code, this.videoElement?.src, this);