Skip to content

Commit

Permalink
Prevent sound notification to throw an exception on mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
astorije committed Nov 8, 2016
1 parent e21ec8b commit dff1a48
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion client/js/lounge.js
Expand Up @@ -1011,7 +1011,11 @@ $(function() {
if (msg.highlight || (options.notifyAllMessages && msg.type === "message")) {
if (!document.hasFocus() || !$(target).hasClass("active")) {
if (options.notification) {
pop.play();
try {
pop.play();
} catch (exception) {
// On mobile, sounds can not be played without user interaction.
}
}
toggleNotificationMarkers(true);

Expand Down

0 comments on commit dff1a48

Please sign in to comment.