Prevent sound notification to throw an exception on mobile
This commit is contained in:
parent
e21ec8b447
commit
dff1a48e05
@ -1011,7 +1011,11 @@ $(function() {
|
|||||||
if (msg.highlight || (options.notifyAllMessages && msg.type === "message")) {
|
if (msg.highlight || (options.notifyAllMessages && msg.type === "message")) {
|
||||||
if (!document.hasFocus() || !$(target).hasClass("active")) {
|
if (!document.hasFocus() || !$(target).hasClass("active")) {
|
||||||
if (options.notification) {
|
if (options.notification) {
|
||||||
pop.play();
|
try {
|
||||||
|
pop.play();
|
||||||
|
} catch (exception) {
|
||||||
|
// On mobile, sounds can not be played without user interaction.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
toggleNotificationMarkers(true);
|
toggleNotificationMarkers(true);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user