fix(studio-server): MPEG-2 and DNxHD videos get a playable preview copy (#7348)

This commit is contained in:
Miguel Ángel
2026-11-07 04:47:20 +00:00
committed by GitHub
parent 65c62f3145
commit 6004508e65
2 changed files with 4 additions and 2 deletions
@@ -231,7 +231,7 @@ describe("BROWSER_HOSTILE_CODECS representative mimes", () => {
expect(typeof BROWSER_HOSTILE_CODECS[codecName]?.representativeMime).toBe("string");
});
it.each(["prores", "mpeg4", "mjpeg"])(
it.each(["prores", "mpeg4", "mjpeg", "mpeg2video", "dnxhd"])(
"has no representative mime for %s, which is never decodable",
(codecName) => {
expect(BROWSER_HOSTILE_CODECS[codecName]?.representativeMime).toBeNull();
@@ -244,7 +244,7 @@ describe("shouldPrewarmProxy", () => {
return { codecName, browserHostile: true, representativeMime: null, hasAlpha: false };
}
it.each(["hevc", "prores", "theora", "mpeg4", "mjpeg"])(
it.each(["hevc", "prores", "theora", "mpeg4", "mjpeg", "mpeg2video", "dnxhd"])(
"pre-warms %s, which has no cross-platform browser decode",
(codecName) => {
expect(shouldPrewarmProxy(facts(codecName))).toBe(true);
@@ -70,6 +70,8 @@ export const BROWSER_HOSTILE_CODECS: Record<string, BrowserHostileCodec> = {
theora: { representativeMime: 'video/ogg; codecs="theora"', prewarm: true },
mpeg4: { representativeMime: null, prewarm: true },
mjpeg: { representativeMime: null, prewarm: true },
mpeg2video: { representativeMime: null, prewarm: true },
dnxhd: { representativeMime: null, prewarm: true },
// Every mainstream engine decodes AV1 and VP9, so canPlayType keeps the
// original and only the rare browser that cannot pays for a transcode.
av1: { representativeMime: 'video/mp4; codecs="av01.0.08M.08"', prewarm: false },