videojs-hotkeys
videojs-hotkeys copied to clipboard
[bug] Spacebar hotkey only works every other time hotkeys() is called
Summary of Problem
On a page that triggeres multiple videos, the hotkeys work perfectly on the first video. However spacebar only works EVERY OTHER TIME. How do you force the SPACE hotkey to work reliably?
Steps to reproduce
- Open https://jsfiddle.net/o82kw4jg/1/ in Chrome OSX (untested in Windows)
- Click one of the 1-5 buttons to trigger a video.
- It works great ... you can hit SPACEBAR, arrows to skip, and numbers to jump.
- Now click any of the 1-5 buttons (same or different) to trigger another video.
- Arrows work, numbers work, but SPACEBAR does not.
- Click a 1-5 button
- SPACEBAR works again.
Expected behaviour
Spacebar always plays/pauses the video, regardless of focus.
Actual behaviour
Spacebar only works every other time.
Bump ... does no-one else experience this??
I'm experiencing the same issue
In your example if I disable alwaysCaptureHotkeys
or captureDocumentHotkeys
it will work perfectly, so I think this two options is mutex.
Pls check the document, you may not need alwaysCaptureHotkeys
, according to experience this option will cause many issues.