videojs-hotkeys icon indicating copy to clipboard operation
videojs-hotkeys copied to clipboard

[bug] Spacebar hotkey only works every other time hotkeys() is called

Open designosis opened this issue 3 years ago • 3 comments

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

  1. Open https://jsfiddle.net/o82kw4jg/1/ in Chrome OSX (untested in Windows)
  2. Click one of the 1-5 buttons to trigger a video.
  3. It works great ... you can hit SPACEBAR, arrows to skip, and numbers to jump.
  4. Now click any of the 1-5 buttons (same or different) to trigger another video.
  5. Arrows work, numbers work, but SPACEBAR does not.
  6. Click a 1-5 button
  7. SPACEBAR works again.

Expected behaviour

Spacebar always plays/pauses the video, regardless of focus.

Actual behaviour

Spacebar only works every other time.

designosis avatar Sep 24 '21 18:09 designosis

Bump ... does no-one else experience this??

designosis avatar Dec 06 '21 18:12 designosis

I'm experiencing the same issue

TomRaz avatar Apr 30 '23 12:04 TomRaz

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.

Ami-OS avatar May 17 '23 15:05 Ami-OS