diff --git a/lib/kotludens/com/persesgames/game/View.kt b/lib/kotludens/com/persesgames/game/View.kt index c212fa6..c1d958a 100644 --- a/lib/kotludens/com/persesgames/game/View.kt +++ b/lib/kotludens/com/persesgames/game/View.kt @@ -32,10 +32,18 @@ fun requestFullscreen() { println("Requesting fullscreen") - if (document.fullscreenEnabled) { - println("fullscreen Enabled") - document.fullscreenElement?.requestFullscreen() + js(""" + if (document.webkitFullscreenElement) { + document.webkitCancelFullScreen(); + } else { + document.documentElement.webkitRequestFullScreen(); } + """) + //if (document.fullscreenEnabled) { + // println("fullscreen Enabled") + //Game.html.container.requestFullscreen() + //document.documentElement?.requestFullscreen() + //} } fun updateView() {