mediaelement / mediaelement-plugins

Plugins for the main mediaelement project
405 stars 137 forks source link

Fix an issue in Quality where the initial button press does not work on a touch device #259

Open nathnolt opened 4 months ago

nathnolt commented 4 months ago

Tested with: chromebook in touch mode,

The problem: Due to the fact that the mouseenter event gets triggered when you click the button, causing both mouseevent and click event to trigger right after each other, making the click cancel out the touchenter event.

This pull request fixes the issue by keeping track of when the last call to hideSelector or showSelector happened, and rejecting it when the time between the last one and the current one is less than 16 milliseconds ago.