Skip to content

Keyboard spacebar shortcut for play/pause only works on first focus. #772

Description

@iastanley
Prerequisites
  • Have you checked for duplicate issues: No duplicates found
  • Which Plugin version are you using: 3.17.14
  • Can you reproduce the issue with our latest release version: yes
  • Can you reproduce the issue with the latest code from master: yes
  • What browser and OS names and versions are you using: Chrome (124.0.6367.201) and Safari (Version 17.4.1), MacOS 14.4.1
  • If applicable, add test code or test page to reproduce:

I made the following modifications to player-ovp.html before running npm run serve:ovp in order to get a working demo of the video player. (all I did was update the provider part of the config and the entryId to match floating.html).

<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta name="theme-color" content="#000000" />
    <meta name="description" content="Kaltura Player Demo Page" />
    <title>Player</title>
    <link rel="stylesheet" type="text/css" href="./style.css" />
    <script src="./kaltura-ovp-player.js" type="text/javascript"></script>
  </head>
  <body>
    <div id="player-placeholder"></div>
    <script type="text/javascript">
      const config = {
        log: {
          level: 'DEBUG'
        },
        targetId: 'player-placeholder',
        provider: {
          partnerId: 1091,
          env: {
            cdnUrl: "http://qa-apache-php7.dev.kaltura.com/",
            serviceUrl: "http://qa-apache-php7.dev.kaltura.com/api_v3"
          }
        }
      };

      const player = KalturaPlayer.setup(config);
      player.loadMedia({ entryId: '0_wifqaipd' });
    </script>
  </body>
</html>
Expected behavior

Using the following modification to get the player-ovp.html demo to work on the latest version of master (as of this writing),

When I focus on the videoplayer and press the spacebar I should be able to toggle pause/play, even after I click away from the videoplayer and back to the videoplayer, no matter where on the video player I click to focus on the video player.

Actual behavior

On first page load, the spacebar toggles play/pause as expected. But if I click away from the video player and back, the spacebar keyboard shortcut no longer works.

I am only able to use the pause/play keyboard shortcut after clicking away if I specifically click directly on the pause/play button, not anywhere else on the video player. As a user, I would expect to be able to start playing the video with the mouse (clicking on the thumbnail of the video) and then be able to use the keyboard spacebar shortcut to toggle play/pause.

Console output

There are no logs/errors associated with this bug. No pause/play events are detected when the spacebar keyboard shortcut fails to work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions