|  |  |  | 
|---|
|  |  |  | let ret = response.data; //JSON.parse(response.data); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (ret.code != 0) { | 
|---|
|  |  |  | // mean failed for offer/anwser exchange | 
|---|
|  |  |  | // mean failed for offer/anwser exchange | 
|---|
|  |  |  | this.dispatch(Events$1.WEBRTC_OFFER_ANWSER_EXCHANGE_FAILED, ret); | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | anwser.type = 'answer'; | 
|---|
|  |  |  | log(this.TAG, 'answer:', ret.sdp); | 
|---|
|  |  |  | this.pc.setRemoteDescription(anwser).then(() => { | 
|---|
|  |  |  | log(this.TAG, 'set remote sucess'); | 
|---|
|  |  |  | log(this.TAG, 'set remote success'); | 
|---|
|  |  |  | }).catch(e => { | 
|---|
|  |  |  | error(this.TAG, e); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | 
|---|
|  |  |  | let ret = response.data; //JSON.parse(response.data); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (ret.code != 0) { | 
|---|
|  |  |  | // mean failed for offer/anwser exchange | 
|---|
|  |  |  | // mean failed for offer/anwser exchange | 
|---|
|  |  |  | this.dispatch(Events$1.WEBRTC_OFFER_ANWSER_EXCHANGE_FAILED, ret); | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | anwser.type = 'answer'; | 
|---|
|  |  |  | log(this.TAG, 'answer:', ret.sdp); | 
|---|
|  |  |  | this.pc.setRemoteDescription(anwser).then(() => { | 
|---|
|  |  |  | log(this.TAG, 'set remote sucess'); | 
|---|
|  |  |  | log(this.TAG, 'set remote success'); | 
|---|
|  |  |  | }).catch(e => { | 
|---|
|  |  |  | error(this.TAG, e); | 
|---|
|  |  |  | }); | 
|---|