Webplayer fullscreen without right click menu?

Is it possible to trigger a webplayer to switch to full screen without using the right click, context menu? I gave it some tests but wasn’t able to find a way to do it, anyone else? I’d like to integrate the option to display fullscreen into the game’s menu instead of asking the player to use a different menu. I’m not talking about filling the browser window, but rather, going to full screen mode (for maximum performance).

I think this is what you want:

hope this helps!

1 Like

I tried that but it didn’t work in the webplayer, but maybe I did something wrong. Works fine in a stand alone though, I’ve used it many times there. Can anyone tell me if Screen.fullScreen is supposed to work in a webplayer? The docs don’t exclude it but also don’t include it as being supported.

it works in the webplayer.
but you must click the webplayer first for it to do anything, as long as the webplayer is inactive it won’t do anything.

also, you naturally must not be on IE8+ as the plugin limitations don’t allow fullscreen there

yeah, I only used it once before and I cant remember if it worked…

So your saying that this does not work in webPlayer?

Screen.fullScreen = true;

Any idea how to work around the IE8 limitation? I’d prefer to keep the right click menu turned off.

Actually, I tried the example in the docs: Screen.fullScreen != Screen.fullScreen; But since you guys say it should work (except in IE8) then I must have done something wrong. I’ll dig into it a bit more.

when using the Screen.fullScreen = !Screen.fullScreen way ensure to not use it in something that at worst could loop or alike cause as the docs point out, it happens at the end of frame and you might potentially reset it back to the original within the frame already

?!?!?!!?

http://forum.unity3d.com/threads/70371-Full-screen-web-player-without-context-menu

Ok, got it to work. Merely giving the webpage focus didn’t seem to do it, I had to link it to a mouse click in the webplayer and that worked. Thanks very much for the heads up!

@Jessy - Dooh! Yeah, forgot I had already opened a thread on this. At least now I know that Screen.fullScreen will work in a webplayer (although I haven’t gone about testing this in IE8 yet).

Can you provide the exact steps involved in forcing Unity player to go into full screen? Your response doesn’t help.

Just create a GUI.Button and assign Screen.fullScreen = true to it. It’s as simple as that.