Call canPlayType
as documented on MDN
This commit is contained in:
parent
1d14bdb005
commit
308cbf5fb7
@ -113,13 +113,15 @@
|
|||||||
let audio;
|
let audio;
|
||||||
if (_converse.play_sounds && !_.isUndefined(window.Audio)) {
|
if (_converse.play_sounds && !_.isUndefined(window.Audio)) {
|
||||||
audio = new Audio(_converse.sounds_path+"msg_received.ogg");
|
audio = new Audio(_converse.sounds_path+"msg_received.ogg");
|
||||||
if (audio.canPlayType('/audio/ogg')) {
|
if (audio.canPlayType('audio/ogg')) {
|
||||||
audio.play();
|
audio.play();
|
||||||
} else {
|
} else {
|
||||||
audio = new Audio(_converse.sounds_path+"msg_received.mp3");
|
audio = new Audio(_converse.sounds_path+"msg_received.mp3");
|
||||||
|
if (audio.canPlayType('audio/mp3')) {
|
||||||
audio.play();
|
audio.play();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
_converse.areDesktopNotificationsEnabled = function () {
|
_converse.areDesktopNotificationsEnabled = function () {
|
||||||
|
Loading…
Reference in New Issue
Block a user