> Unlike <img> tags, <video> posters have no standard way of specifying many URLs for fetching the optimal format supported by the client.
Actually, you can do it without needing any scripting, though the technique is convoluted: use as the poster an SVG image (encoded inline as a data URI), containing a <foreignObject>, containing an HTML <picture> element. It ends up roughly this (with superfluous whitespace added):
https://blog.uidrafter.com/conditional-avif-for-video-poster...