rossi46 Posted January 17, 2018 Share Posted January 17, 2018 How to set and cancel pixi game in mobile. I use some code but not work: if (document.documentElement.requestFullscreen) { document.documentElement.requestFullscreen(); } else if (document.documentElement.mozRequestFullScreen) { document.documentElement.mozRequestFullScreen(); } else if (document.documentElement.webkitRequestFullscreen) { document.documentElement.webkitRequestFullscreen(); } else if (document.documentElement.msRequestFullscreen) { document.documentElement.msRequestFullscreen(); } Quote Link to comment Share on other sites More sharing options...
Exca Posted January 17, 2018 Share Posted January 17, 2018 You should request fullscreen for the canvas instead of the document: renderer.view.requestFullScreen() In addition to that some mobile browsers do not support fullscreen. Quote Link to comment Share on other sites More sharing options...
themoonrat Posted January 17, 2018 Share Posted January 17, 2018 And make sure to request it within a callback for a valid mouse or touch event https://github.com/sindresorhus/screenfull.js/ Helps cover the various browser prefixes b10b 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.