How to use the screenfull.onerror function in screenfull

To help you get started, we’ve selected a few screenfull examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github HearthSim / Joust / ts / components / GameWidget.tsx View on Github external
this.setState({
					isLogVisible: true,
					isLogMounted: true,
				});
			}
		});
		this.props.sink.on("gamestate", this.cb.bind(this));
		if (this.state.isFullscreenAvailable) {
			screenfull.onchange(() => {
				if (screenfull.isFullscreen) {
					this.onAttainFullscreen();
				} else {
					this.onReleaseFullscreen();
				}
			});
			screenfull.onerror(() => {
				this.setState({ fullscreenError: true });
				this.clearFullscreenErrorTimeout();
				this.fullscreenErrorTimeout = window.setTimeout(() => {
					this.setState({ fullscreenError: false });
				}, 3000);
			});
		}
		this.cardOracleCb = this.updateCardOracle.bind(this);
		this.mulliganOracleCb = this.updateMulliganOracle.bind(this);
		if (this.props.cardOracle) {
			this.props.cardOracle.on("cards", this.cardOracleCb);
		}
		if (this.props.cardOracle) {
			this.props.mulliganOracle.on("mulligans", this.mulliganOracleCb);
		}
	}