diff --git a/ui/component/viewers/videoViewer/internal/videojs.jsx b/ui/component/viewers/videoViewer/internal/videojs.jsx index be0a6bcbf..2f1ed5373 100644 --- a/ui/component/viewers/videoViewer/internal/videojs.jsx +++ b/ui/component/viewers/videoViewer/internal/videojs.jsx @@ -38,6 +38,7 @@ export type Player = { controlBar: { addChild: (string, any) => void, }, + autoplay: (any) => boolean, }; type Props = { diff --git a/ui/component/viewers/videoViewer/view.jsx b/ui/component/viewers/videoViewer/view.jsx index 13a6f7378..4afa0502c 100644 --- a/ui/component/viewers/videoViewer/view.jsx +++ b/ui/component/viewers/videoViewer/view.jsx @@ -221,6 +221,12 @@ function VideoViewer(props: Props) { ); Promise.race([playPromise, timeoutPromise]).catch((error) => { + if (typeof error === 'object' && error.name && error.name === 'NotAllowedError') { + if (player.autoplay() && !player.muted()) { + player.muted(true); + } + } + if (PLAY_TIMEOUT_ERROR) { const retryPlayPromise = player.play(); Promise.race([retryPlayPromise, timeoutPromise]).catch((error) => {