[js] Add exception catching for onRtcCreateRecver.
@@ -44,6 +44,7 @@ export default class SFU extends EventEmitter {
}
async onCreateSender(pubid) {
+ try {
let sender = await this.rtc.createSender();
sender.pc.onicecandidate = async (e) => {
if (!sender.senderOffer) {
@@ -58,6 +59,9 @@ export default class SFU extends EventEmitter {
}
let desc = await sender.pc.createOffer({ offerToReceiveVideo: false, offerToReceiveAudio: false })
sender.pc.setLocalDescription(desc);
+ }catch(error){
+ console.log('onCreateSender error => ' + error);
+ }
}
async onRtcCreateRecver(pubid) {
