dtinth / superwhite

display a very bright white color on HDR-enabled displays
1.21k stars 17 forks source link

Switch to WebM version #4

Open notpushkin opened 1 year ago

notpushkin commented 1 year ago

For smaller size and better browser support. Kudos @Emilgardis for the tip!

Closes #3?

Checklist before merging:

Test [superwhite.webm](https://github.com/dtinth/superwhite/assets/193136/4bca9e4b-ce8d-4a46-8baa-9151af2ce1c0)
dtinth commented 1 year ago

unfortunately, it is unplayable on an iPad ;-;

image
dtinth commented 1 year ago

i think we can keep both webm and mp4 version in the repo.

the webm version is quite useful if you only target desktop devices.

also the webm version is embeddable on Discord (macOS) whereas the mp4/HEVC file isn't.

notpushkin commented 1 year ago

Let's bring MP4 back then. I'll play around with FFmpeg to see if we can get a smaller one, too.

You can then add a <video> tag with two sources to support both desktop and iPad:

<video muted autoplay playsinline oncanplaythrough="this.currentTime=0">
  <source src="superwhite.webm" type="video/webm" />
  <source src="superwhite.mp4" type="video/mp4; codecs=hvc1" />
</video>
gallium-gonzollium commented 1 month ago

I managed to make a demo of this in a webpage, if anyone’s interested: https://superwhite.netlify.app Maybe people could use this to check compatibiliy or something.