Skip to content

Commit fa40436

Browse files
feat(attachments): Add webm visualization support (#93207)
feat(attachments): Add webm visualization support
1 parent 3754859 commit fa40436

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

static/app/components/events/attachmentViewers/previewAttachmentTypes.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import ImageViewer from 'sentry/components/events/attachmentViewers/imageViewer'
22
import JsonViewer from 'sentry/components/events/attachmentViewers/jsonViewer';
33
import LogFileViewer from 'sentry/components/events/attachmentViewers/logFileViewer';
44
import RRWebJsonViewer from 'sentry/components/events/attachmentViewers/rrwebJsonViewer';
5+
import {WebMViewer} from 'sentry/components/events/attachmentViewers/webmViewer';
56
import type {IssueAttachment} from 'sentry/types/group';
67

78
export const getInlineAttachmentRenderer = (
@@ -26,6 +27,8 @@ export const getInlineAttachmentRenderer = (
2627
case 'image/png':
2728
case 'image/gif':
2829
return ImageViewer;
30+
case 'video/webm':
31+
return WebMViewer;
2932
default:
3033
return undefined;
3134
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import {css} from '@emotion/react';
2+
3+
import type {ViewerProps} from 'sentry/components/events/attachmentViewers/utils';
4+
import {getAttachmentUrl} from 'sentry/components/events/attachmentViewers/utils';
5+
import PanelItem from 'sentry/components/panels/panelItem';
6+
import {t} from 'sentry/locale';
7+
8+
interface WebMViewerProps
9+
extends Pick<ViewerProps, 'attachment' | 'eventId' | 'orgSlug' | 'projectSlug'> {}
10+
11+
export function WebMViewer(props: WebMViewerProps) {
12+
return (
13+
<PanelItem>
14+
<video
15+
controls
16+
css={css`
17+
max-width: 100%;
18+
`}
19+
>
20+
<source src={getAttachmentUrl(props, true)} type="video/webm" />
21+
{t('Your browser does not support the video tag.')}
22+
</video>
23+
</PanelItem>
24+
);
25+
}

0 commit comments

Comments
 (0)