We are working on fixing some accessibility issues on our video player, one of which is the ability to scrub through the video with the keyboard.(我们正在努力解决视频播放器上的一些可访问性问题,其中之一是可以使用键盘擦洗视频。)
We have the following code, which pauses the video on keydown and scrubs the video forward/backward and then on keyup it plays the video at the new point.(我们有以下代码,它在按下按键时暂停视频并向前/向后擦洗视频,然后在按下按键时在新点播放视频。)
The issue is that in IE11 with JAWS the keydown event does not keep firing while the key is held down.(问题在于,在带有JAWS的IE11中,按下键时,按下事件不会持续触发。) It goes back and forth between keydown and keyup.(它在按下和按下之间来回移动。) The result is an endless loop of moving one second forward and then going back to the original point in the video and playing.(结果是一个无尽的循环,向前移动一秒钟,然后返回到视频中的原始点并播放。)
Here is the code that we are using currently, is there anything that we can do to make this work with JAWS?(这是我们当前正在使用的代码,我们可以做些什么来使JAWS正常工作吗?)
document.addEventListener("keydown", function(ev) {
if (ev.keyCode === 37 || ev.keyCode === 39) {
console.log("keydown");
}
});
document.addEventListener("keyup", function(ev) {
if (ev.keyCode === 37 || ev.keyCode === 39) {
console.log("keyup");
});
happy to add any additional information you may need or to answer any questions, just let me know(很乐意添加您可能需要的任何其他信息或回答任何问题,请告诉我)
ask by idontwantnoscrubs translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…