screen - HTML5 canvas 怎样防止屏幕自动睡眠并检测(手机和平板)锁屏事件?
天蓬老师
天蓬老师 2017-04-17 13:59:35
0
1
441

在GitHub看到这个项目,但那个是针对video标签的,而且issues里面一堆反馈XX设备测试无效的。。。

然后是检测手动锁屏,这个用Page Visitable API能在Android实现,但我在iOS7测试失败(包括chrome),不知是不是iOS版本过低的原因。。。
而且对于桌面来说,如果直接切换窗口(整个浏览器为非活动窗口),这个API也没反应。。。

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(1)
Ty80

Looping a one-second (very short) video in Android can prevent automatic sleep. Finally, there is no need to use new APIs that are not officially supported by browsers. iOS seems to use a JavaScript timer to continuously self.location to prevent the screen from automatically sleeping, but it is said that this is not effective in iOS7. . .

Using Page Visitable API on Android can detect lock screen events, but the test on iOS7 is invalid. It is not clear on other versions of iOS.

Not completely resolved, continue to wait for the answer.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!