function EnterVRButton(sourceCanvas, options) {
    _classCallCheck(this, EnterVRButton);

    var _this = _possibleConstructorReturn(this, (EnterVRButton.__proto__ || Object.getPrototypeOf(EnterVRButton)).call(this));

    options = options || {};

    options.color = options.color || 'rgb(80,168,252)';
    options.background = options.background || false;
    options.disabledOpacity = options.disabledOpacity || 0.5;
    options.height = options.height || 55;
    options.corners = options.corners || 'square';
    options.cssprefix = options.cssprefix || 'webvr-ui';

    options.textEnterVRTitle = options.textEnterVRTitle || 'ENTER VR';
    options.textVRNotFoundTitle = options.textVRNotFoundTitle || 'VR NOT FOUND';
    options.textExitVRTitle = options.textExitVRTitle || 'EXIT VR';

    options.onRequestStateChange = options.onRequestStateChange || function () {
      return true;
    };
    options.beforeEnter = options.beforeEnter || function () {
      return new Promise(function (resolve) {
        return resolve();
      });
    };
    options.beforeExit = options.beforeExit || function () {
      return new Promise(function (resolve) {
        return resolve();
      });
    };

    options.injectCSS = options.injectCSS !== false;

    _this.options = options;

    _this.sourceCanvas = sourceCanvas;

    // Pass in your own domElement if you really dont want to use ours
    _this.domElement = options.domElement || (0, _dom.createDefaultView)(options);
    _this.__defaultDisplayStyle = _this.domElement.style.display || 'initial';

    // Create WebVR Manager
    _this.manager = new _webvrManager2.default();
    _this.manager.checkDisplays();
    _this.manager.addListener('change', function (state) {
      return _this.__onStateChange(state);
    });

    // Bind button click events to __onClick
    _this.domElement.addEventListener('click', function () {
      return _this.__onEnterVRClick();
    });

    _this.__forceDisabled = false;
    _this.setTitle(_this.options.textEnterVRTitle);
    return _this;
  }
Construct a new Enter VR Button
@constructor
@param {HTMLCanvasElement} sourceCanvas the canvas that you want to present in WebVR
@param {Object} [options] optional parameters
@param {HTMLElement} [options.domElement] provide your own domElement to bind to
@param {Boolean} [options.injectCSS=true] set to false if you want to write your own styles
@param {Function} [options.beforeEnter] should return a promise, opportunity to intercept request to enter
@param {Function} [options.beforeExit] should return a promise, opportunity to intercept request to exit
@param {Function} [options.onRequestStateChange] set to a function returning false to prevent default state changes
@param {string} [options.textEnterVRTitle] set the text for Enter VR
@param {string} [options.textVRNotFoundTitle] set the text for when a VR display is not found
@param {string} [options.textExitVRTitle] set the text for exiting VR
@param {string} [options.color] text and icon color
@param {string} [options.background] set to false for no brackground or a color
@param {string} [options.corners] set to 'round', 'square' or pixel value representing the corner radius
@param {string} [options.disabledOpacity] set opacity of button dom when disabled
@param {string} [options.cssprefix] set to change the css prefix from default 'webvr-ui'