1***@qq.com
1***@qq.com
  • 发布:2019-04-24 11:10
  • 更新:2019-04-24 11:10
  • 阅读:1613

使用HTML+在安卓电视盒子上面的响应遥控按钮,页面切换后document.onkeydown失效

分类:HTML5+

遥控按钮响应主要是通过 document.addEventListener("keydown") 或者在 onplusReady中绑定都会出现失效的状态
(function(mui,$){
window.addEventListener("DOMContentLoaded",function(e){
document.addEventListener("keydown",function(event)
{
handleKeydown(event);
},false);
})
})(mui,jQuery)

开发一个安卓电视盒子的应用,需要响应遥控按键.
index.html为隐藏主页面,负责响应事件调度页面.
list.html中为列表页面 在 plusReady中添加 document.addEventListener("keydown" 去处理遥控码
play.html为播放页面.
页面都是通过 openWindow 指定了 style: {plusrequire: 'later'}, 和 createNew: true,目的是希望PlusReady一直会调用

整个流程:
(1)index.html ---> list.html ------>play.html(遥控响应正常)
(2)play.html (beforeback中跳转到) --->index.html--->list.html (遥控响应失败)
/////////////////////////////////////////////////////////////////////////////////

之前我发过一个帖子
http://ask.dcloud.net.cn/question/68353

2019-04-24 11:10 负责人:无 分享
已邀请:

该问题目前已经被锁定, 无法添加新回复