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:
parent
a80e55d38d
commit
c8d3b51640
2 changed files with 19 additions and 3 deletions
|
@ -190,12 +190,21 @@ export default class MVideoBody extends React.PureComponent<IBodyProps, IState>
|
|||
} else {
|
||||
logger.log("NOT preloading video");
|
||||
const content = this.props.mxEvent.getContent<IMediaEventContent>();
|
||||
|
||||
let mimetype = content?.info?.mimetype;
|
||||
|
||||
// clobber quicktime muxed files to be considered MP4 so browsers
|
||||
// are willing to play them
|
||||
if (mimetype == "video/quicktime") {
|
||||
mimetype = "video/mp4";
|
||||
}
|
||||
|
||||
this.setState({
|
||||
// For Chrome and Electron, we need to set some non-empty `src` to
|
||||
// enable the play button. Firefox does not seem to care either
|
||||
// way, so it's fine to do for all browsers.
|
||||
decryptedUrl: `data:${content?.info?.mimetype},`,
|
||||
decryptedThumbnailUrl: thumbnailUrl || `data:${content?.info?.mimetype},`,
|
||||
decryptedUrl: `data:${mimetype},`,
|
||||
decryptedThumbnailUrl: thumbnailUrl || `data:${mimetype},`,
|
||||
decryptedBlob: null,
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue