Fix exception when scene preview is unavailable (#1477)

This commit is contained in:
Still Hsu 2021-06-03 20:05:43 +09:00 committed by GitHub
parent 7164bb28ac
commit 2ce4d9f0d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -35,7 +35,7 @@ export const ScenePreview: React.FC<IScenePreviewProps> = ({
entries.forEach((entry) => {
if (entry.intersectionRatio > 0)
// Catch is necessary due to DOMException if user hovers before clicking on page
videoEl.current?.play().catch(() => {});
videoEl.current?.play()?.catch(() => {});
else videoEl.current?.pause();
});
});