openvidu-browser: Handled promise rejection on getCommonStats

pull/651/head
csantosm 2021-09-01 11:36:20 +02:00
parent 04e8581149
commit 8ce647c35b
1 changed files with 61 additions and 55 deletions

View File

@ -353,6 +353,7 @@ export class WebRtcStats {
return new Promise(async (resolve, reject) => {
try {
const statsReport: any = await this.stream.getRTCPeerConnection().getStats();
const response: IWebrtcStats = this.getWebRtcStatsResponseOutline();
const videoTrackStats = ['framesReceived', 'framesDropped', 'framesSent', 'frameHeight', 'frameWidth'];
@ -416,6 +417,11 @@ export class WebRtcStats {
}
return resolve(response);
} catch (error) {
logger.error('Error getting common stats: ', error);
return reject(error);
}
});
}