From fdd9b015135a97aae01be1a451a2f62e290af834 Mon Sep 17 00:00:00 2001 From: DispatchCommit Date: Tue, 22 Jun 2021 09:44:10 -0700 Subject: [PATCH] fix autoplay for transcoded files --- ui/component/viewers/videoViewer/view.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ui/component/viewers/videoViewer/view.jsx b/ui/component/viewers/videoViewer/view.jsx index cb57320eb..26a30a120 100644 --- a/ui/component/viewers/videoViewer/view.jsx +++ b/ui/component/viewers/videoViewer/view.jsx @@ -234,10 +234,13 @@ function VideoViewer(props: Props) { Promise.race([playPromise, timeoutPromise]).catch((error) => { if (typeof error === 'object' && error.name && error.name === 'NotAllowedError') { // Autoplay disallowed by browser + player.play(); } + // Autoplay failed if (PLAY_TIMEOUT_ERROR) { - // Autoplay failed + setIsLoading(false); + setIsPlaying(false); } else { setIsLoading(false); setIsPlaying(false);