I'm trying to learn how to use webRTC in applications so I wrote a code sample available in the following link: http://wklej.org/hash/fd599a32e8e/
At the beginning I need to say that I don't care about browsers compatibility, All I need is to support Chromium web engine without any external adapters/other libraries.
The web application should allow me to establish a connection between two browser tabs running on the same host — by manually exchange of appropriate data (SDP and ICE candidates).
Steps to follow:
- Click on "create offer button", copy local SDP;
- Go to other tab and insert previously copied SDP into "remote SDP" area, then press "create answer";
- Copy generated local SDP, go to first tab, insert into "remote SDP" area and click on "set remote sdp" button (not create answer button);
- Exchange ice candidates — copy them from one tab, insert to the second one and press "addCandidates" button. Do the same in the other way.
The main problem is that this function:
peer.iceconnectionstatechange = function(event) {
console.log("ice connection state: " + peer.iceConnectionState)
}
won't be triggered. I tried to play with STUN/TURN servers without success. The remote video won't run. If somebody could point out where I made mistake?
create answer
button does nothing following your steps ? – Roko C. Buljancreate answer
button takes offerer sdp which has been copied from the first tab. It tries to set it as remote descriptor and then create an answer which has to be used as remote sdp in the first tab (step 2 and 3) – krzysztof