Embed: remove forbidden modern code (blegh! filthy modern stuff brrr) from the webrtc wrapper

This commit is contained in:
Cat 2021-10-07 15:55:49 +02:00 committed by Thulinma
parent b6068f4627
commit 615fad6be9
10 changed files with 79 additions and 27 deletions

View file

@ -602,15 +602,16 @@ p.prototype.build = function (MistVideo,callback) {
me.api.getStats = function(){
if (me.webrtc && me.webrtc.isConnected) {
return new Promise(function(resolve,reject) {
me.webrtc.peerConn.getStats().then((a) => {
me.webrtc.peerConn.getStats().then(function(a){
var r = {
audio: null,
video: null
};
for (let dictionary of a.values()) {
if (dictionary.type == "track") {
var obj = Object.fromEntries(a);
for (var i in obj) {
if (obj[i].type == "track") {
//average jitter buffer in seconds
r[dictionary.kind] = dictionary;
r[obj[i].kind] = obj[i];
}
}
resolve(r);