# final solution for fullscreen on mobile browsers?

**URL:** <https://phaser.discourse.group/t/final-solution-for-fullscreen-on-mobile-browsers/14022>\
**Category:** Phaser 3\
**Created:** [February 22, 2024, 4:25pm UTC](https://phaser.discourse.group/t/final-solution-for-fullscreen-on-mobile-browsers/14022 "2024-02-22T16:25:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jromero1077](https://avatars.discourse-cdn.com/v4/letter/j/a587f6/32.png) [@jromero1077](https://phaser.discourse.group/u/jromero1077)\
**Post date:** [February 22, 2024, 4:25pm UTC](https://phaser.discourse.group/t/final-solution-for-fullscreen-on-mobile-browsers/14022/1 "2024-02-22T16:25:48Z")

</div>

Hi,  
New to Phaser and really enjoying it so far but have this one issue that is difficult to get help with.

I gathered a lot of posts and examples for achieving fullscreen on a mobile device. Seems like its not working in phaser and actually I couldnt get it to work using plain JS either. I couldn’t find a working solution or even a straight answer.

I looked at competitor HTML5 games on mobile and I concluded that

1. can’t force orientation
2. can’t launch in a specific orientation
3. they can achieve fullscreen but in landscape mode only and with a swipe up\*

I tried with phaser and plain JS on mobile (in landscape)

1. startFullscreen() does not work (listening to ‘pointerup’) - fires event ‘fullscreenunsupported’
2. requestFullscreen() does not work (listening to ‘pointerup’ or ‘touchend’ via window.addEventListener)

\*So I am wondering how those competitor html5 games do it because it IS possible.

Please if anyone can point me to a working example. I am not a lazy person Im enjoying learning Phaser but the inconsistencies with this particular issue is tiring me out.

Thanks for replies,  
Jon

---

<div class="post-metadata">

**Author:** ![samme](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/samme/32/5275_2.png) [@samme](https://phaser.discourse.group/u/samme)\
**Post date:** [February 22, 2024, 4:32pm UTC](https://phaser.discourse.group/t/final-solution-for-fullscreen-on-mobile-browsers/14022/2 "2024-02-22T16:32:45Z")

</div>

> [@jromero1077](#):
>
> they can achieve fullscreen but in landscape mode only and with a swipe up

I think this is just a fake fullscreen using some CSS.

---

<div class="post-metadata">

**Author:** ![Zoombies](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/zoombies/32/6553_2.png) [@Zoombies](https://phaser.discourse.group/u/Zoombies)\
**Post date:** [June 20, 2024, 7:08pm UTC](https://phaser.discourse.group/t/final-solution-for-fullscreen-on-mobile-browsers/14022/3 "2024-06-20T19:08:06Z")

</div>

We are attempting this using [PWA](https://en.wikipedia.org/wiki/Progressive_web_app), still figuring out some issues with it

You can try our mobile app experience [here](https://zoombies.world/bonez/) It has only been tested on Android, we are in the process of trying to get the memory down for Safari on iPhone.

---

<div class="post-metadata">

**Author:** ![Qugurun](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/qugurun/32/5132_2.png) [@Qugurun](https://phaser.discourse.group/u/Qugurun)\
**Post date:** [June 21, 2024, 8:53am UTC](https://phaser.discourse.group/t/final-solution-for-fullscreen-on-mobile-browsers/14022/4 "2024-06-21T08:53:22Z")

</div>

You can view the size of the window and rotate the camera based on this data, so that the game will always be in a horizontal view.

`this.camera.setAngle(90);`

To make the game full screen, this code works for me.

```javascript
mySprite.setInteractive();
mySprite.on('pointerup', function () {
	if (this.scale.isFullscreen) {
		this.scale.stopFullscreen();
	}
	else {
		this.scale.startFullscreen();
	}
}, this);

```

---

<div class="post-metadata">

**Author:** ![Zoombies](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/zoombies/32/6553_2.png) [@Zoombies](https://phaser.discourse.group/u/Zoombies)\
**Post date:** [June 21, 2024, 10:59am UTC](https://phaser.discourse.group/t/final-solution-for-fullscreen-on-mobile-browsers/14022/5 "2024-06-21T10:59:52Z")

</div>

ooo thank you ! didn’t think of this

will implement
