[SOLVED] Fullscreen API is deprecated?

Hi, Im calling this method

this.app.enableFullscreen();

It works but it throws this exception

playcanvas-stable.dbg.js:44129 DEPRECATED: pc.Application#enableFullscreen is deprecated. Use the Fullscreen API directly.

I look for the Fullscreen API on the docs and didn’t find matches, what’s the proper method? Thanks

Yohami

So, getting a web app going fullscreen used to be complex since it wasn’t always the same process in each browser.

Playcanvas used to have a method in the pc.Application class that provided a single method that tried to take care of browsers differences. That now has changed, there is a Javascript API available to work directly with that for going fullscreen.

You can find details on how to use it here:

1 Like

Thanks, document.body.requestFullscreen(); did it

3 Likes