diff --git a/html/janus.js b/html/janus.js
index 67d5e6f101..5d07c49d3e 100644
--- a/html/janus.js
+++ b/html/janus.js
@@ -2897,8 +2897,10 @@ function Janus(gatewayCallbacks) {
var config = pluginHandle.webrtcStuff;
if(!config.volume[stream])
config.volume[stream] = { value: 0 };
- // Start getting the volume, if getStats is supported
- if(config.pc.getStats && Janus.webRTCAdapter.browserDetails.browser === "chrome") {
+ // Start getting the volume, if audioLevel in getStats is supported (apparently
+ // they're only available in Chrome/Safari right now: https://webrtc-stats.callstats.io/)
+ if(config.pc.getStats && (Janus.webRTCAdapter.browserDetails.browser === "chrome" ||
+ Janus.webRTCAdapter.browserDetails.browser === "safari")) {
if(remote && !config.remoteStream) {
Janus.warn("Remote stream unavailable");
return 0;
@@ -2911,16 +2913,13 @@ function Janus(gatewayCallbacks) {
config.volume[stream].timer = setInterval(function() {
config.pc.getStats()
.then(function(stats) {
- var results = stats.result();
- for(var i=0; i