muxinc / elements

Custom elements for working with media in the browser that Just Work™
https://elements-demo-nextjs.vercel.app
MIT License
266 stars 49 forks source link

Bug: Cannot disable play / pause on spacebar press #879

Open donalffons opened 9 months ago

donalffons commented 9 months ago

Is there an existing issue for this?

Which Mux Elements/Packages does this apply to? Select all that apply

mux-player-react

Which browsers are you using?

Chrome

Which operating systems are you using?

Other (add details below)

Description

I would like to playback video "programmatically", i.e. without Mux Player's controls or keyboard listeners.

Reduced test case

No response

Steps to reproduce

I'm using the following code:

  <MuxPlayer
    playbackId={pageData.header.video.asset.playbackId}
    preload="auto"
    autoPlay
    loop
    muted
    playsInline
    className="h-screen w-full object-cover"
    style={{
      // @ts-ignore
      "--controls": "none",
    }}
    nohotkeys
  />

Current Behavior

Playback works and the controls are hidden. But, when I focus the video by clicking on it, I can play / pause by hitting spacebar.

Expected Behavior

My expectation is that the nohotkey prop would disable that. I did check the docs and issues and couldn't find a way to disable play / pause on spacebar.

Errors

No response

What version of the package are you using?

No response

cjpillsbury commented 8 months ago

Hey @donalffons haven't been able to dig too deeply into this, but this does appear to be a bug. Thanks for reporting! I'll keep you posted when we're able to get this into our priority queue.