videojs/video.js

Missing case in Dom.isSingleLeftClick

Open

#7,736 opened on Apr 25, 2022

View on GitHub
 (16 comments) (0 reactions) (0 assignees)JavaScript (39,742 stars) (7,502 forks)batch import
confirmedgood first issue

Description

Description

On mac, tapping the touchpad may be interpreted in two ways and thus, passed down to the browser in different ways (briefly discussed here), but one of them is not accounted for in Dom.isSingleLeftClick. More specifically, when button === 0 && buttons === 1. Therefore, handleMouseDown of SeekBar does not recognize such an event as click and the event gets dismissed by Dom.isSingleLeftClick(event) (line 798 here) called in the body of handleMouseDown (line 252 here).

It then may take 2-3 (up to 8, sometimes) taps to actually handle mouse down (and to change volume or current time, as consequence).

Returning true if button === 0 && buttons === 1 should do the trick 😊

Steps to reproduce

Explain in detail the exact steps necessary to reproduce the issue.

  1. On a mac, try tapping (not clicking) around the video search bar or the volume bar to change volume or current time. Can be observed also on the official website's player.

Results

Expected

On each tap, the slider, be it sound or time control, changes its position accordingly

Actual

Due to the nature of the hardware (briefly discussed here), 2-3 taps are needed to actually change the position

Error output

None

Additional Information

versions

videojs

7.17.0

browsers

Tried on latest desktop versions of Chrome, Opera, Firefox, Safari and Edge

OSes

Mac 12.3.1

plugins

None

Contributor guide