Skip to content

Conversation

@EmanuelMedinaAraujo
Copy link
Contributor

Motivation and Context

When watching a VOD and clicking on any control bar button (e.g., fullscreen), the button remains focused. Pressing Space to pause the video instead triggers a click on the focused button, causing unintended behavior (e.g., exiting fullscreen instead of pausing).
This is a known video.js bug: videojs/video.js#2669

Description

This PR implements a workaround for the video.js button focus issue. A document-level keydown event listener using the capture phase intercepts Space key presses before they reach the button's native handlers. When Space is pressed while a control bar button (.vjs-control-bar) is focused, the button is blurred via blur(), allowing the hotkey handler to process the key event normally.

Steps for Testing

  1. Log in
    2.Navigate to a VOD stream
    3.Click on the fullscreen button in the video player control bar
    4.Observe the fullscreen button has a visible focus ring
    5.Press the Space key
    6.✅ Video should pause/play instead of toggling fullscreen

Copilot AI review requested due to automatic review settings December 21, 2025 22:32
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements a workaround for a known video.js issue where pressing Space while a control bar button is focused triggers the button instead of pausing/playing the video. The solution intercepts Space key presses during the capture phase and blurs focused control bar buttons before the player's hotkey handler processes the event.

Key Changes:

  • Added document-level keydown listener with capture phase to detect Space key presses on focused control bar buttons
  • Modified play button positioning in the control bar (changed from skipBackwardIndex + 1 to skipBackwardIndex)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@EmanuelMedinaAraujo EmanuelMedinaAraujo force-pushed the fix_pause_shortcut_in_fullscreen branch from 2028fdd to 95e4509 Compare December 21, 2025 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant