Browse Source

Adds method used by torture to obtain current audio levels.

master
damencho 9 years ago
parent
commit
029ccf3b31
1 changed files with 20 additions and 0 deletions
  1. 20
    0
      modules/statistics/statistics.js

+ 20
- 0
modules/statistics/statistics.js View File

@@ -113,5 +113,25 @@ export default {
113 113
                 CallStats.sendAddIceCandidateFailed(e, pc);
114 114
             }
115 115
         );
116
+    },
117
+    /**
118
+     * FIXME:
119
+     * Currently used by torture. If we are removing this, torture needs to
120
+     * be fixed also.
121
+     *
122
+     * Obtains audio level reported in the stats for specified peer.
123
+     * @param peerJid full MUC jid of the user for whom we want to obtain last
124
+     *        audio level.
125
+     * @param ssrc the SSRC of audio stream for which we want to obtain audio
126
+     *        level.
127
+     * @returns {*} a float form 0 to 1 that represents current audio level or
128
+     *              <tt>null</tt> if for any reason the value is not available
129
+     *              at this time.
130
+     */
131
+    getPeerSSRCAudioLevel: function (peerJid, ssrc) {
132
+
133
+        var peerStats = rtpStats.jid2stats[peerJid];
134
+
135
+        return peerStats ? peerStats.ssrc2AudioLevel[ssrc] : null;
116 136
     }
117 137
 };

Loading…
Cancel
Save