mirror of https://github.com/OpenVidu/openvidu.git
openvidu-browser: Replaced setInterval by setTimeout
parent
52d4ba3f7e
commit
c3be4453d8
|
@ -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);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue