Draft
This page is not complete.
This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The RTCIceServer dictionary's credentialType property is a string value from the RTCIceCredentialType enum which indicates what type of credential the RTCIceServer.credential value is. The default is "password".
var iceServer = {
...
credentialType = ["password" | "token"],
...
};
var credential = iceServer.credentialType;
iceServer.credential = ["password" | "token"]; The RTCIceCredentialType enum specifies values which can be returned by the credentialType property to define what kind of authentication credential is being provided in the RTCIceServer.credential property. This can be one of the values below.
| Constant | Description |
|---|---|
"password" | The credential is a long-term authentication password. See RFC 5389, section 10.2 for further details on this type of credential. |
"token" | The credential is an access token to be used with a third-party authentication system. |
This example creates a new RTCPeerConnection which will use a TURN server at turnserver.example.org to negotiate connections. Logging into the TURN server will use the username "webrtc" and the creative password "turnpassword".
myPeerConnection = new RTCPeerConnection({
iceServers: [
{
urls: "turn:turnserver.example.org", // A TURN server
username: "webrtc",
credential: "turnpassword",
credentialType: "password"
}
]
}); | Specification | Status | Comment |
|---|---|---|
| WebRTC 1.0: Real-time Communication Between Browsers The definition of 'RTCIceServer.credential' in that specification. | Candidate Recommendation | Initial specification. |
| Desktop | ||||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
| Basic support | Yes | ? | 47 | ? | ? | ? |
| Mobile | |||||||
|---|---|---|---|---|---|---|---|
| Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
| Basic support | No | Yes | ? | 47 | ? | ? | Yes |
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/RTCIceServer/credentialType