Is it possible in JavaScript to detect if the browser's monitor supports HDR?
I have the requirement to display a HDR certificate on a webpage when the visitor is using a HDR monitor, but I've expressed to the client that this might not be possible. We've been able to embed video that supports HDR and it plays back correctly on Chrome for Windows.
So far in my research I've found no way of detecting such a capability.
The closest thing I've found is the Screen.colorDepth API
if (screen.colorDepth >= 48 && window.matchMedia('(color-gamut: p3)').matches && /* other checks */) { /* use HDR content */ } else { /* use SDR content */ }
– Hatfield