From 324f3faec2dff951825d5a07444938062af0a784 Mon Sep 17 00:00:00 2001 From: alexbcberio Date: Wed, 5 Jan 2022 19:14:35 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A5=85=20Try/catch=20audio.play?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/app.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/app.js b/client/app.js index 1717793..c2093e4 100644 --- a/client/app.js +++ b/client/app.js @@ -183,7 +183,11 @@ function russianRoulette({ userDisplayName, message }) { }, 1250); } - audio.play(); + try { + audio.play(); + } catch(e) { + // user didn't interact with the document first + } } }); }