我试图将一些事件附加到我的iPad网络应用程序中的
HTML5视频元素,但它们似乎没有被触发?我已经在设备和模拟器中测试了这两个,并得到相同的结果.然而,事件(至少为onclick)在桌面Safari中工作正常.我也试过交换一个div的视频元素,事件是否正常?有没有人遇到这个,有一个工作的想法?
Test video swipevar theVid = document.getElementById("currentlyPlaying");
theVid.addEventListener('touchstart',function(e){
e.preventDefault();
console.log("touchstart");
},false);
theVid.addEventListener('click',function(e){
e.preventDefault();
console.log("click");
},false);
theVid.addEventListener('touchmove',function(e){
console.log("touchmove");
},false);
theVid.addEventListener('touchend',function(e){
console.log("touchend");
},false);
theVid.addEventListener('touchcancel',function(e){
console.log("touchcancel");
},false);