# 有乐游戏黑屏/灰屏问题
# 问题描述
在 cocos 的游戏中,会有机器偶现黑屏,或者灰屏的问题。
游戏日志中报错
01-04 21:24:17.604 32295-32295/com.sixjoy.cymini I/WebGameHelper: ConsoleMessage Failed to execute 'requestFullscreen' on 'Element': API can only be initiated by a user gesture. -- From line 1 of http://hupd-t.592you.com/tank/cocos2d-js-min.e9427.js
1
在部分浏览器上,非用户手势触发时调用requestFullscreen
接口会导致问题
# 解决方案
查找 main.js
文件中 调用的 enableAutoFullScreen
方法,把它换成cc.view.enableAutoFullScreen(false);
,如下图:
参考资料: https://forum.cocos.org/t/qq-app-ccc-h5/57934 (opens new window)