You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-11 20:22:36 +03:00
fix quicktime video thumbnailing (#8108)
when reading quicktime files for thumbnailing and/or display, clobber the mimetype from `video/quicktime` to be `video/mp4` so browsers don't choke on it.
This commit is contained in:
@@ -292,7 +292,14 @@ function loadVideoElement(videoFile): Promise<HTMLVideoElement> {
|
||||
reject(e);
|
||||
};
|
||||
|
||||
video.src = ev.target.result as string;
|
||||
let dataUrl = ev.target.result as string;
|
||||
// Chrome chokes on quicktime but likes mp4, and `file.type` is
|
||||
// read only, so do this horrible hack to unbreak quicktime
|
||||
if (dataUrl.startsWith("data:video/quicktime;")) {
|
||||
dataUrl = dataUrl.replace("data:video/quicktime;", "data:video/mp4;");
|
||||
}
|
||||
|
||||
video.src = dataUrl;
|
||||
video.load();
|
||||
video.play();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user