(desc)
| 150 | } |
| 151 | |
| 152 | async function handleLocalDescription(desc) { |
| 153 | pc1.setLocalDescription(desc); |
| 154 | console.log('Offer from pc1:\n', desc.sdp); |
| 155 | pc2.setRemoteDescription(desc); |
| 156 | try { |
| 157 | const remoteAnswer = await pc2.createAnswer(); |
| 158 | handleRemoteAnswer(remoteAnswer); |
| 159 | } catch (e) { |
| 160 | console.error('Error when creating remote answer: ', e); |
| 161 | } |
| 162 | } |
| 163 | |
| 164 | function handleRemoteAnswer(desc) { |
| 165 | pc2.setLocalDescription(desc); |
no test coverage detected