From d293818acca678bfcd6b2744c058d48c55047f21 Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Mon, 19 Jul 2021 03:34:15 +0300 Subject: [PATCH] Video: Prefer element over server duration (#1294) --- src/components/middle/message/Video.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/middle/message/Video.tsx b/src/components/middle/message/Video.tsx index 3abccd142..f13c4f2a3 100644 --- a/src/components/middle/message/Video.tsx +++ b/src/components/middle/message/Video.tsx @@ -98,7 +98,7 @@ const Video: FC = ({ setPlayProgress(Math.max(0, e.currentTarget.currentTime - 1)); }, []); - const duration = video.duration || (videoRef.current && videoRef.current.duration) || 0; + const duration = (videoRef.current && videoRef.current.duration) || video.duration || 0; const isOwn = isOwnMessage(message); const isForwarded = isForwardedMessage(message);