diff --git a/dom/media/PeerConnection.js b/dom/media/PeerConnection.js index 4bde9ce7942d..8a67205a92dd 100644 --- a/dom/media/PeerConnection.js +++ b/dom/media/PeerConnection.js @@ -586,6 +586,13 @@ RTCPeerConnection.prototype = { throw new this._win.DOMException(msg + " - missing credential: " + urlStr, "InvalidAccessError"); } + if (server.credentialType != "password") { + this.logWarning("RTCConfiguration TURN credentialType \""+ + server.credentialType + + "\" is not yet implemented. Treating as password."+ + " https://bugzil.la/1247616", + null, 0); + } } else if (!(url.scheme in { stun:1, stuns:1 })) { throw new this._win.DOMException(msg + " - improper scheme: " + url.scheme, diff --git a/dom/webidl/RTCConfiguration.webidl b/dom/webidl/RTCConfiguration.webidl index 71aa436004c6..072d9ba70e4f 100644 --- a/dom/webidl/RTCConfiguration.webidl +++ b/dom/webidl/RTCConfiguration.webidl @@ -7,11 +7,17 @@ * http://dev.w3.org/2011/webrtc/editor/webrtc.html#idl-def-RTCConfiguration */ +enum RTCIceCredentialType { + "password", + "token" +}; + dictionary RTCIceServer { (DOMString or sequence) urls; DOMString url; //deprecated - DOMString? credential = null; - DOMString? username = null; + DOMString username; + DOMString credential; + RTCIceCredentialType credentialType = "password"; }; enum RTCIceTransportPolicy { diff --git a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp index ff875e39f4ca..ec9b2a016e06 100644 --- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp +++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp @@ -663,8 +663,8 @@ PeerConnectionConfiguration::AddIceServer(const RTCIceServer &aServer) port = (isStuns || isTurns)? 5349 : 3478; if (isTurn || isTurns) { - NS_ConvertUTF16toUTF8 credential(aServer.mCredential); - NS_ConvertUTF16toUTF8 username(aServer.mUsername); + NS_ConvertUTF16toUTF8 credential(aServer.mCredential.Value()); + NS_ConvertUTF16toUTF8 username(aServer.mUsername.Value()); if (!addTurnServer(host.get(), port, username.get(),