With chrome prior version 71.0.3578.98 and firefox 64.0.2 or 65.0 the same code works fine.
It fails creating the offer, so the localDescription is never updated.
Any clue of the root cause or how to progress to find a solution?
Debugging with chrome://webrtc-internals/ I can see a setLocalDescriptionOnFailure , now I need to know why and how to fix it.
This the code:
let RTCPeerConnection = window.RTCPeerConnection
|| window.mozRTCPeerConnection
|| window.webkitRTCPeerConnection;
let useWebKit = !!window.webkitRTCPeerConnection;
if (!RTCPeerConnection) {
let win = iframe.contentWindow;
RTCPeerConnection = win.RTCPeerConnection
|| win.mozRTCPeerConnection
|| win.webkitRTCPeerConnection;
useWebKit = !!win.webkitRTCPeerConnection;
}
let mediaConstraints = {
optional: [{RtpDataChannels: true}]
};
let servers = {iceServers: [{urls: 'stun:stun.services.mozilla.com'}]};
let pc = new RTCPeerConnection(servers, mediaConstraints);
pc.createDataChannel('');
pc.createOffer((result) => {
pc.setLocalDescription(result, () => {}, () => {});
}, () => {});
setTimeout(function () {
let lines = pc.localDescription.sdp.split('\n');
lines.forEach(function (line) {
if (line.indexOf('a=candidate:') === 0) {
handleCandidate(line);
}
});
}, 1000);
"v=0
o=- 8970400063416288228 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE 0
a=msid-semantic: WMS
m=application 9 UDP/TLS/RTP/SAVPF 121
c=IN IP4 0.0.0.0
b=AS:30
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:zDvW
a=ice-pwd:VPi3OhCXtz5wLxrQZPr0txvz
a=ice-options:trickle
a=fingerprint:sha-256 03:6D:03:81:7D:DF:6F:1B:07:ED:FF:08:4B:C4:39:
A8:1A:86:57:5A:6F:95:68:DC:73:B0:2D:DF:0B:4A:60:89
a=setup:actpass
a=mid:0
a=sendrecv
a=msid:
a=rtcp-mux
a=rtpmap:121 google-data/90000
a=ssrc:2367456832 cname:zVi7CadofeEcO1vV
a=ssrc:2367456832 msid:-
a=ssrc:2367456832 mslabel:-
a=ssrc:2367456832 label: