From 0feecccef170421252eaad0b9902bd8d1e40047d Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 24 Mar 2022 11:59:20 +0000 Subject: [PATCH] Wire up file preview for video files (#8140) --- .../views/dialogs/UploadConfirmDialog.tsx | 55 +++++++++++-------- src/components/views/voip/VideoFeed.tsx | 2 +- src/utils/blobs.ts | 1 + 3 files changed, 34 insertions(+), 24 deletions(-) diff --git a/src/components/views/dialogs/UploadConfirmDialog.tsx b/src/components/views/dialogs/UploadConfirmDialog.tsx index 612903a6ee..0b6c4d0add 100644 --- a/src/components/views/dialogs/UploadConfirmDialog.tsx +++ b/src/components/views/dialogs/UploadConfirmDialog.tsx @@ -33,8 +33,8 @@ interface IProps { @replaceableComponent("views.dialogs.UploadConfirmDialog") export default class UploadConfirmDialog extends React.Component { - private objectUrl: string; - private mimeType: string; + private readonly objectUrl: string; + private readonly mimeType: string; static defaultProps = { totalFiles: 1, @@ -69,7 +69,7 @@ export default class UploadConfirmDialog extends React.Component { }; render() { - let title; + let title: string; if (this.props.totalFiles > 1 && this.props.currentIndex !== undefined) { title = _t( "Upload files (%(current)s of %(total)s)", @@ -82,23 +82,23 @@ export default class UploadConfirmDialog extends React.Component { title = _t('Upload files'); } - let preview; - if (this.mimeType.startsWith('image/')) { - preview =
-
-
-
{ this.props.file.name } ({ filesize(this.props.file.size) })
-
-
; + let preview: JSX.Element; + let placeholder: JSX.Element; + if (this.mimeType.startsWith("image/")) { + preview = ( + + ); + } else if (this.mimeType.startsWith("video/")) { + preview = ( +