exitVR() {
    var self = this;
    var vrManager = this.renderer.xr;

    // Don't exit VR if not in VR.
    if (!this.is('vr-mode') && !this.is('ar-mode')) {
      return Promise.resolve('Not in immersive mode.');
    }

    // Handle exiting VR if not yet already and in a headset or mobile.
    if (this.checkHeadsetConnected() || this.isMobile) {
      vrManager.enabled = false;
      if (this.hasWebXR) {
        this.xrSession.removeEventListener('end', this.exitVRBound);
        // Capture promise to avoid errors.
        this.xrSession.end().then(function () {}, function () {});
        this.xrSession = undefined;
      } else {
        throw Error('Failed to exit VR - no WebXR');
      }
    } else {
      exitFullscreen();
    }

    // Handle exiting VR in all other cases (2D fullscreen, external exit VR event).
    exitVRSuccess();
    return Promise.resolve();
    function exitVRSuccess() {
      self.removeState('vr-mode');
      self.removeState('ar-mode');
      // Lock to landscape orientation on mobile.
      if (self.isMobile && screen.orientation && screen.orientation.unlock) {
        screen.orientation.unlock();
      }
      // Exiting VR in embedded mode, no longer need fullscreen styles.
      if (self.hasAttribute('embedded')) {
        self.removeFullScreenStyles();
      }
      self.resize();
      if (self.isIOS) {
        _utils_index_js__WEBPACK_IMPORTED_MODULE_6__.forceCanvasResizeSafariMobile(self.canvas);
      }
      self.renderer.setPixelRatio(window.devicePixelRatio);
      self.emit('exit-vr', {
        target: self
      });
    }
  }
Call `xrSession.end` if WebXR.
Handle events, states, fullscreen styles.

@returns {Promise}