首页 > 其他分享 >cocos手机端屏幕常亮

cocos手机端屏幕常亮

时间:2024-07-12 10:27:01浏览次数:15  
标签:index cocos 常亮 nosleep 浏览器 手机 屏幕 页面

直接用nosleep.js在手机端没生效,没走进那个唤醒的函数里,估计是cocos在手机浏览器端的navigator.wakeLock用不了或者cocos把手机端的click阻止了,我在电脑端是可以唤醒的。上面的这个的方法其实和nosleep是一样的,大概就像是你在浏览器一直看视频,你的手机并不会灭屏那样

<video controls autoplay="true" muted="muted" loop width="0" height="0">
    <source
      src="
      data:video/mp4;base64,AAAAHGZ0eXBNNFYgAAACAGlzb21pc28yYXZjMQAAAAhmcmVlAAAGF21kYXTeBAAAbGliZmFhYyAxLjI4AABCAJMgBDIARwAAArEGBf//rdxF6b3m2Ui3lizYINkj7u94MjY0IC0gY29yZSAxNDIgcjIgOTU2YzhkOCAtIEguMjY0L01QRUctNCBBVkMgY29kZWMgLSBDb3B5bGVmdCAyMDAzLTIwMTQgLSBodHRwOi8vd3d3LnZpZGVvbGFuLm9yZy94MjY0Lmh0bWwgLSBvcHRpb25zOiBjYWJhYz0wIHJlZj0zIGRlYmxvY2s9MTowOjAgYW5hbHlzZT0weDE6MHgxMTEgbWU9aGV4IHN1Ym1lPTcgcHN5PTEgcHN5X3JkPTEuMDA6MC4wMCBtaXhlZF9yZWY9MSBtZV9yYW5nZT0xNiBjaHJvbWFfbWU9MSB0cmVsbGlzPTEgOHg4ZGN0PTAgY3FtPTAgZGVhZHpvbmU9MjEsMTEgZmFzdF9wc2tpcD0xIGNocm9tYV9xcF9vZmZzZXQ9LTIgdGhyZWFkcz02IGxvb2thaGVhZF90aHJlYWRzPTEgc2xpY2VkX3RocmVhZHM9MCBucj0wIGRlY2ltYXRlPTEgaW50ZXJsYWNlZD0wIGJsdXJheV9jb21wYXQ9MCBjb25zdHJhaW5lZF9pbnRyYT0wIGJmcmFtZXM9MCB3ZWlnaHRwPTAga2V5aW50PTI1MCBrZXlpbnRfbWluPTI1IHNjZW5lY3V0PT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AAAAAIAAAABAAAABgAAAAEAAAABAAAABwAAAAIAAAABAAAACAAAAAEAAAABAAAACQAAAAIAAAABAAAACgAAAAEAAAABAAAACwAAAAIAAAABAAAADQAAAAEAAAABAAAADgAAAAIAAAABAAAADwAAAAEAAAABAAAAEAAAAAIAAAABAAAAEQAAAAEAAAABAAAAEgAAAAIAAAABAAAAFAAAAAEAAAABAAAAFQAAAAIAAAABAAAAFgAAAAEAAAABAAAAFwAAAAIAAAABAAAAGAAAAAEAAAABAAAAGQAAAAIAAAABAAAAGgAAAAEAAAABAAAAGwAAAAIAAAABAAAAHQAAAAEAAAABAAAAHgAAAAIAAAABAAAAHwAAAAQAAAABAAAA4HN0c3oAAAAAAAAAAAAAADMAAAAaAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw"
      type="video/mp4">
    Your browser does not support the video tag.
  </video>

在打包后的index.html页面或者模板的index.ejs页面加入下面的代码:

image

标签:index,cocos,常亮,nosleep,浏览器,手机,屏幕,页面
From: https://blog.csdn.net/zdxbig/article/details/140372027

相关文章

  • cocos Buffer的问题
    结果问题:Nodejs直接用Buffer就可以了,但是cocos这边,不能直接用根据大大的方式:报没有默认导出,改了一下声明文件报这个错误:估计b没被正确解析又改了一下:然后还是有问题:打断点看看:变成了一个包含Buffer的对象,我需要的是Buffer就很奇怪:好像声明文件里的就是B......
  • Python:彻底告别微信截图,摆脱屏幕限制,一键截图整张表,几秒钟完成8000分钟工作量
    目录摘要Excel截图的痛点传统截图方法的弊端Python自动化:办公效率的革命技术解决方案实现代码核心优势结果展示结语:自动化,让工作更简单摘要在数字化办公时代,Excel表格的分享与汇报变得日益频繁。但传统截图方式在面对超长表格或海量数据时显得力不从心。本文将介......
  • ABAP小技巧+PARAMETERS选择屏幕单选为空查不到数据
    今天在使用报表查数据时,发现只输入物料号(多选框)查不出数据,要将公司代码(单选框)一起输入才能查出数据。选择屏幕设计界面如下:后台表数据如下:情况一:(查不出数据)DEBUG界面显示,内表GT_ZTFM0004为空,P_BUKRS(工厂代码字段)没有值情况二:(能查到值)DEBUG界面如下:其实这个情况就......
  • 下载oss2上面的屏幕截图文件的代码
    importosimportreimportoss2importtkinterastkfromtkinterimportfiledialog,messageboxfromtkinter.scrolledtextimportScrolledTextimportpicklefromtkinterimportfiledialogimportsubprocessdefon_entry_focus_in(event):#当Entry获得焦点......
  • Cocos 7.2~7.4
    这几天没更新CSDN,跑去玩Cocos了。自从知道我的粉丝百分之十之八九都是假人,更新确实没什么动力了。主要还是把这边当成一个日记本吧。选择cocos的原因也很简单。会点js,技术栈比较接近,上手估计也快。简单记录下这几天的内容主要完成了三个小游戏,按照Bilibili的siki老师的教程......
  • osg使用整理(12):SSAO屏幕空间环境光遮蔽
    一、基础概念1、SSAO:通过将褶皱、孔洞和非常靠近墙面变暗的方法,近似模拟间接光照。SSAO称为屏幕空间环境光遮蔽,使用屏幕空间场景的深度而不是真实的几何体数据来确定遮蔽量,速度快效果好。2、实现原理:根据物体表面法线方向生成一个半球随机深度采样,主要看物体周围深度值大小,通......
  • CocosCreator客户端优化系列:CPU占用及性能优化
    CocosCreator客户端优化系列(四):CPU占用及性能优化转载请保留原文链接:https://blog.csdn.net/zzx023/article/details/88991314这篇文章是优化系列的最后一篇了,内容会长一些,更多的是提供一些方向以及思路,具体的一些细节由于篇幅有限,就不一一说明了,只要找对方向,就可以慢慢研究。希望......
  • 如何使用 CSS 实现响应式布局,以适应不同屏幕尺寸和设备类型?
    要实现响应式布局,可以使用CSS媒体查询和其他CSS属性进行适应不同屏幕尺寸和设备类型的布局调整。以下是实现响应式布局的一般步骤:使用viewport元标签:在html文件的元素中添加以下代码,以确保页面在移动设备上正确显示:<metaname="viewport"content="width=device-width,......
  • Klipper RP2040 display ssd1306 0.96 屏幕配置
    接线屏幕接线parampinGNDGNDVCCVCCSCLSDA编码器接线parampinGNDGNDEN1VCCEN2CLklipper配置#显示屏及旋钮[display]lcd_type:ssd1306#i2c_bus:i2c0dencoder_pins:^gpio24,^gpio23encoder_steps_per_detent:2c......
  • Cocos 编译发布微信小程序
     微信小游戏不允许远程加载脚本,所以这里会和其他web的打包生成的不一样然后把remote文件夹拷贝到服务器上,让文件资源域名指向remote的上一级,然后可以通过域名:/remote/main访问到config.json即可 ......