[Posts] Only show the webm if browser supports vp9

I'm not happy with this solution, but we might as well try it.

- Most reasonably modern browsers support vp9.
- Those that cannot can play mp4 instead.
- Browsers that support only vp8 are basically non-existent.
This commit is contained in:
Sindrake 2024-07-21 18:04:06 -07:00
parent 0e98266024
commit e72c0f4bd5

View File

@ -488,7 +488,7 @@ Post.resize_video = function (post, target_size) {
let desired_classes = [];
function original_sources () {
target_sources.push({type: "video/webm", url: post?.file?.url});
target_sources.push({type: "video/webm; codecs=\"vp9\"", url: post?.file?.url});
if (typeof post?.sample?.alternates?.original !== "undefined")
target_sources.push({type: "video/mp4", url: post?.sample?.alternates?.original?.urls[1]});
}