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

View File

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