1
0
mirror of https://github.com/spacebarchat/client.git synced 2024-11-22 18:32:34 +01:00

add audio attachment player

This commit is contained in:
Puyodead1 2023-09-11 23:06:12 -04:00
parent 7fc50fae54
commit f307f48c39
No known key found for this signature in database
GPG Key ID: A4FA4FEC0DD353FC

View File

@ -46,6 +46,8 @@ export default function MessageAttachment({ attachment, contextMenuItems, maxWid
finalElement = <Image src={url} alt={attachment.filename} width={scaledWidth} height={scaledHeight} />; finalElement = <Image src={url} alt={attachment.filename} width={scaledWidth} height={scaledHeight} />;
} else if (attachment.content_type?.startsWith("video")) { } else if (attachment.content_type?.startsWith("video")) {
finalElement = <Video attachment={attachment} />; finalElement = <Video attachment={attachment} />;
} else if (attachment.content_type?.startsWith("audio")) {
finalElement = <audio src={url} controls />;
} else { } else {
logger.warn(`Unknown attachment type: ${attachment.content_type}`); logger.warn(`Unknown attachment type: ${attachment.content_type}`);
} }