capture(canvas, proceedToNextFrame) {
    // console.log(`outside-hubble-capture ${this.capturing} ${this.isRecording()}`);

    if (!this.capturing && this.isRecording()) {
      // console.log('hubble-capture');

      this.capturing = true;
      // capture current canvas, i.e.
      // const can = document.getElementsByClassName('mapboxgl-canvas')[0];
      // const can = document.getElementById('default-deckgl-overlay');
      this._capture(canvas).then(data => {
        this.capturing = false;
        if (data.kind === 'step') {
          console.log(`data.nextTimeMs: ${data.nextTimeMs}`);
          proceedToNextFrame(data.nextTimeMs);
        } else if (data.error === 'STOP') {
          console.log('data.error: STOP');
          this.stop(this.onStop);
        } else {
          console.log(data);
        }
      });
    }
  }
/**
   * Capture a frame of the canvas.
   * @param {(nextTimeMs: number) => void} proceedToNextFrame
   */
Capture a frame of the canvas.
Capture a frame of the canvas .
capture(canvas, proceedToNextFrame) {
    if (!this.capturing && this.isRecording()) {
      this.capturing = true;
      this._capture(canvas).then(data => {
        this.capturing = false;
        if (data.kind === 'step') {
          console.log(`data.nextTimeMs: ${data.nextTimeMs}`);
          proceedToNextFrame(data.nextTimeMs);
        } else if (data.error === 'STOP') {
          console.log('data.error: STOP');
          this.stop(this.onStop);
        } else {
          console.log(data);
        }
      });
    }
  }
capture ( canvas , proceedToNextFrame ) { if ( ! this . capturing && this . isRecording ( ) ) { this . capturing = true ; this . _capture ( canvas ) . then ( data => { this . capturing = false ; if ( data . kind === 'step' ) { console . log ( ` ${ data . nextTimeMs } ` ) ; proceedToNextFrame ( data . nextTimeMs ) ; } else if ( data . error === 'STOP' ) { console . log ( 'data.error: STOP' ) ; this . stop ( this . onStop ) ; } else { console . log ( data ) ; } } ) ; } }
Capture a frame of the canvas.
Capture a frame of the canvas .
// console.log(`outside-hubble-capture ${this.capturing} ${this.isRecording()}`); // console.log('hubble-capture'); // capture current canvas, i.e. // const can = document.getElementsByClassName('mapboxgl-canvas')[0]; // const can = document.getElementById('default-deckgl-overlay');