mirror of https://github.com/OpenVidu/openvidu.git
openvidu-browser: Handled promise rejection on getCommonStats
parent
04e8581149
commit
8ce647c35b
|
@ -353,6 +353,7 @@ export class WebRtcStats {
|
||||||
|
|
||||||
return new Promise(async (resolve, reject) => {
|
return new Promise(async (resolve, reject) => {
|
||||||
|
|
||||||
|
try {
|
||||||
const statsReport: any = await this.stream.getRTCPeerConnection().getStats();
|
const statsReport: any = await this.stream.getRTCPeerConnection().getStats();
|
||||||
const response: IWebrtcStats = this.getWebRtcStatsResponseOutline();
|
const response: IWebrtcStats = this.getWebRtcStatsResponseOutline();
|
||||||
const videoTrackStats = ['framesReceived', 'framesDropped', 'framesSent', 'frameHeight', 'frameWidth'];
|
const videoTrackStats = ['framesReceived', 'framesDropped', 'framesSent', 'frameHeight', 'frameWidth'];
|
||||||
|
@ -416,6 +417,11 @@ export class WebRtcStats {
|
||||||
}
|
}
|
||||||
|
|
||||||
return resolve(response);
|
return resolve(response);
|
||||||
|
} catch (error) {
|
||||||
|
logger.error('Error getting common stats: ', error);
|
||||||
|
return reject(error);
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue