mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-18 07:50:13 +00:00
fix(studio-server): proxy MPEG-4 Part 2 and MJPEG video the browser cannot decode (#7310)
* fix(studio-server): proxy MPEG-4 Part 2 and MJPEG video the browser cannot decode * fix(studio-server): drop the codec comment the comment gate counts
This commit is contained in:
@@ -231,9 +231,12 @@ describe("BROWSER_HOSTILE_CODECS representative mimes", () => {
|
||||
expect(typeof BROWSER_HOSTILE_CODECS[codecName]?.representativeMime).toBe("string");
|
||||
});
|
||||
|
||||
it("has no representative mime for prores, which is never decodable", () => {
|
||||
expect(BROWSER_HOSTILE_CODECS.prores?.representativeMime).toBeNull();
|
||||
});
|
||||
it.each(["prores", "mpeg4", "mjpeg"])(
|
||||
"has no representative mime for %s, which is never decodable",
|
||||
(codecName) => {
|
||||
expect(BROWSER_HOSTILE_CODECS[codecName]?.representativeMime).toBeNull();
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
describe("shouldPrewarmProxy", () => {
|
||||
@@ -241,7 +244,7 @@ describe("shouldPrewarmProxy", () => {
|
||||
return { codecName, browserHostile: true, representativeMime: null, hasAlpha: false };
|
||||
}
|
||||
|
||||
it.each(["hevc", "prores", "theora"])(
|
||||
it.each(["hevc", "prores", "theora", "mpeg4", "mjpeg"])(
|
||||
"pre-warms %s, which has no cross-platform browser decode",
|
||||
(codecName) => {
|
||||
expect(shouldPrewarmProxy(facts(codecName))).toBe(true);
|
||||
|
||||
@@ -68,6 +68,8 @@ export const BROWSER_HOSTILE_CODECS: Record<string, BrowserHostileCodec> = {
|
||||
hevc: { representativeMime: 'video/mp4; codecs="hvc1.1.6.L120.B0"', prewarm: true },
|
||||
prores: { representativeMime: null, prewarm: true },
|
||||
theora: { representativeMime: 'video/ogg; codecs="theora"', prewarm: true },
|
||||
mpeg4: { representativeMime: null, prewarm: true },
|
||||
mjpeg: { 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 },
|
||||
|
||||
Reference in New Issue
Block a user