prevent replay hover from restarting playback (#33364)

* prevent replay hover from restarting playback

* Fix issue with hover, it's supposed to be a FileBody and not an actual video on replay

* Add test for replay video on hover
This commit is contained in:
Zack
2026-05-04 11:53:31 +00:00
committed by GitHub
parent b3f9fc1a0c
commit a9edffead8
2 changed files with 66 additions and 3 deletions
@@ -26,7 +26,7 @@ import { renderReplyTile } from "../../../events/EventTileFactory";
import { type GetRelationsForEvent } from "../rooms/EventTile";
import { MatrixClientPeg } from "../../../MatrixClientPeg";
import { type IBodyProps } from "../messages/IBodyProps";
import { FileBodyFactory, renderMBody } from "../messages/MBodyFactory";
import { FileBodyFactory, VideoBodyFactory, renderMBody } from "../messages/MBodyFactory";
interface IProps {
mxEvent: MatrixEvent;
@@ -134,9 +134,9 @@ export default class ReplyTile extends React.PureComponent<IProps> {
const msgtypeOverrides: Record<string, React.ComponentType<IBodyProps>> = {
[MsgType.Image]: MImageReplyBody,
// Override audio and video body with file body. We also hide the download/decrypt button using CSS
// Override audio body with file body. We also hide the download/decrypt button using CSS
[MsgType.Audio]: isVoiceMessage(mxEvent) ? MVoiceMessageBody : ReplyTileFileBody,
[MsgType.Video]: ReplyTileFileBody,
[MsgType.Video]: VideoBodyFactory,
};
const evOverrides: Record<string, React.ComponentType<IBodyProps>> = {
// Use MImageReplyBody so that the sticker isn't taking up a lot of space