Freeedle / Essential-Audio-Player

Essential Audio Player JS is a simple, clean and minimal JavaScript / HTML5 / CSS web audio player.
https://essential-audio-player.net
Other
41 stars 3 forks source link

Google Lighthouse Warning #6

Closed matthewcobb closed 6 months ago

matthewcobb commented 6 months ago

Google Lighthouse is showing a warning that is related to the touchstart event listeners.

image

It recommends adding passive: true to any touchstart event listeners:

document.addEventListener('touchstart', onTouchStart, {passive: true})

More info here: https://developer.chrome.com/docs/lighthouse/best-practices/uses-passive-event-listeners/?utm_source=lighthouse&utm_medium=lr

Freeedle commented 6 months ago

Tried to implement it, but it has negative side effects that disturb the player’s functionality. Have to take a deeper look into that.

Freeedle commented 6 months ago

Done. Built into the newly released v2.0! As this has implications on the player’s behavior on mobile devices that may not be liked by everyone, it comes as an option. You can choose which way to go. Activate passive listeners by adding the attribute data-passive (no values) to the player div.