src/components/avatar-recorder.js
function () {
    var trackedControllerEls = this.trackedControllerEls;
    var self = this;

    if (this.isRecording) { return; }

    log('Starting recording!');

    if (this.el.components['avatar-replayer']) {
      this.el.components['avatar-replayer'].stopReplaying();
    }

    // Get camera.
    this.setupCamera(function cameraSetUp () {
      self.isRecording = true;
      // Record camera.
      self.cameraEl.components['motion-capture-recorder'].startRecording();
      // Record tracked controls.
      Object.keys(trackedControllerEls).forEach(function startRecordingController (id) {
        trackedControllerEls[id].components['motion-capture-recorder'].startRecording();
      });
    });
  }
function () {
    var trackedControllerEls = this.trackedControllerEls;
    var self = this;

    if (this.isRecording) { return; }

    log('Starting recording!');

    if (this.el.components['avatar-replayer']) {
      this.el.components['avatar-replayer'].stopReplaying();
    }

    // Get camera.
    this.setupCamera(function cameraSetUp () {
      self.isRecording = true;
      // Record camera.
      self.cameraEl.components['motion-capture-recorder'].startRecording();
      // Record tracked controls.
      Object.keys(trackedControllerEls).forEach(function startRecordingController (id) {
        trackedControllerEls[id].components['motion-capture-recorder'].startRecording();
      });
    });
  }
function ( ) { var trackedControllerEls = this . trackedControllerEls ; var self = this ; if ( this . isRecording ) { return ; } log ( 'Starting recording!' ) ; if ( this . el . components [ 'avatar-replayer' ] ) { this . el . components [ 'avatar-replayer' ] . stopReplaying ( ) ; } // Get camera. this . setupCamera ( function cameraSetUp ( ) { self . isRecording = true ; // Record camera. self . cameraEl . components [ 'motion-capture-recorder' ] . startRecording ( ) ; // Record tracked controls. Object . keys ( trackedControllerEls ) . forEach ( function startRecordingController ( id ) { trackedControllerEls [ id ] . components [ 'motion-capture-recorder' ] . startRecording ( ) ; } ) ; } ) ; }
Start recording camera and tracked controls.
Start recording camera and tracked controls .