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

    if (this.data.cameraOverride) {
      prepareCamera(this.data.cameraOverride);
      return;
    }

    // Grab camera.
    if (el.camera && el.camera.el) {
      prepareCamera(el.camera.el);
      return;
    }

    el.addEventListener('camera-set-active', function setup (evt) {
      prepareCamera(evt.detail.cameraEl);
      el.removeEventListener('camera-set-active', setup);
    });

    function prepareCamera (cameraEl) {
      if (self.cameraEl) {
        self.cameraEl.removeAttribute('motion-capture-recorder');
      }
      self.cameraEl = cameraEl;
      cameraEl.setAttribute('motion-capture-recorder', {
        autoRecord: false,
        visibleStroke: false
      });
      doneCb(cameraEl)
    }
  }
function (doneCb) {
    var el = this.el;
    var self = this;

    if (this.data.cameraOverride) {
      prepareCamera(this.data.cameraOverride);
      return;
    }

    // Grab camera.
    if (el.camera && el.camera.el) {
      prepareCamera(el.camera.el);
      return;
    }

    el.addEventListener('camera-set-active', function setup (evt) {
      prepareCamera(evt.detail.cameraEl);
      el.removeEventListener('camera-set-active', setup);
    });

    function prepareCamera (cameraEl) {
      if (self.cameraEl) {
        self.cameraEl.removeAttribute('motion-capture-recorder');
      }
      self.cameraEl = cameraEl;
      cameraEl.setAttribute('motion-capture-recorder', {
        autoRecord: false,
        visibleStroke: false
      });
      doneCb(cameraEl)
    }
  }
function ( doneCb ) { var el = this . el ; var self = this ; if ( this . data . cameraOverride ) { prepareCamera ( this . data . cameraOverride ) ; return ; } // Grab camera. if ( el . camera && el . camera . el ) { prepareCamera ( el . camera . el ) ; return ; } el . addEventListener ( 'camera-set-active' , function setup ( evt ) { prepareCamera ( evt . detail . cameraEl ) ; el . removeEventListener ( 'camera-set-active' , setup ) ; } ) ; function prepareCamera ( cameraEl ) { if ( self . cameraEl ) { self . cameraEl . removeAttribute ( 'motion-capture-recorder' ) ; } self . cameraEl = cameraEl ; cameraEl . setAttribute ( 'motion-capture-recorder' , { autoRecord : false , visibleStroke : false } ) ; doneCb ( cameraEl ) } }
Set motion capture recorder on the camera once the camera is ready.
Set motion capture recorder on the camera once the camera is ready .