openvidu-browser: Replaced setInterval by setTimeout

pull/550/head
csantosm 2020-10-08 18:10:39 +02:00
parent 52d4ba3f7e
commit c3be4453d8
1 changed files with 1 additions and 2 deletions

View File

@ -1134,7 +1134,7 @@ export class Session extends EventDispatcher {
this.openvidu.isAndroidBrowser() || this.openvidu.isSamsungBrowser() || this.openvidu.isAndroidBrowser() || this.openvidu.isSamsungBrowser() ||
(this.openvidu.isIPhoneOrIPad() && this.openvidu.isIOSWithSafari()) (this.openvidu.isIPhoneOrIPad() && this.openvidu.isIOSWithSafari())
) { ) {
const statsRequest = setInterval(async () => { setTimeout(async () => {
const statsMap = await streamManager.stream.getWebRtcPeer().pc.getStats(); const statsMap = await streamManager.stream.getWebRtcPeer().pc.getStats();
statsMap.forEach((stats) => { statsMap.forEach((stats) => {
@ -1148,7 +1148,6 @@ export class Session extends EventDispatcher {
if (error) { if (error) {
logger.error("Error sending 'videoData' event", error); logger.error("Error sending 'videoData' event", error);
} }
clearInterval(statsRequest);
}); });
} }
}); });