From ad08a3d0cc5e5bd1b7a5c77db0e055d8814f0ee5 Mon Sep 17 00:00:00 2001 From: Seungmin Kim <8457324+ehfd@users.noreply.github.com> Date: Sat, 23 Mar 2024 13:05:09 +0900 Subject: [PATCH] Revert input.js for now --- addons/gst-web/src/input.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/gst-web/src/input.js b/addons/gst-web/src/input.js index c2262b4f..71094f59 100644 --- a/addons/gst-web/src/input.js +++ b/addons/gst-web/src/input.js @@ -495,8 +495,8 @@ class Input { /** * When fullscreen is entered, request keyboard and pointer lock. */ - _onFullscreenChange(e) { - if (e.matches) { + _onFullscreenChange() { + if (document.fullscreenElement !== null) { // Enter fullscreen this.requestKeyboardLock(); this.element.requestPointerLock(); @@ -540,7 +540,7 @@ class Input { this.listeners.push(addListener(this.element, 'resize', this._windowMath, this)); this.listeners.push(addListener(this.element, 'wheel', this._mouseWheelWrapper, this)); this.listeners.push(addListener(this.element, 'contextmenu', this._contextMenu, this)); - this.listeners.push(addListener(window.matchMedia('(display-mode: fullscreen)'), 'change', this._onFullscreenChange, this)); + this.listeners.push(addListener(this.element.parentElement, 'fullscreenchange', this._onFullscreenChange, this)); this.listeners.push(addListener(document, 'pointerlockchange', this._pointerLock, this)); this.listeners.push(addListener(window, 'keydown', this._key, this)); this.listeners.push(addListener(window, 'keyup', this._key, this));