这是
实验性技术
检查
浏览器兼容性表格
要小心谨慎在生产中使用这之前。
The read-only property
RTCPeerConnection.remoteDescription
返回
RTCSessionDescription
describing the session (which includes configuration and media information) for the remote end of the connection. If this hasn't been set yet, this is
null
.
The returned value typically reflects a remote description which has been received over the signaling server (as either an offer or an answer) and then put into effect by your code calling
RTCPeerConnection.setRemoteDescription()
in response.
var sessionDescription = peerConnection.remoteDescription;
On a more fundamental level, the returned value is the value of
RTCPeerConnection.pendingRemoteDescription
if that property isn't
null
; otherwise, the value of
RTCPeerConnection.currentRemoteDescription
is returned. See
Pending and current descriptions
in
WebRTC connectivity
for details on this algorithm and why it's used.
This example looks at the
remoteDescription
and displays an alert containing the
RTCSessionDescription
对象的
type
and
sdp
字段。
var pc = new RTCPeerConnection();
…
var sd = pc.remoteDescription;
if (sd) {
alert("Remote session: type='" +
sd.type + "'; sdp description='" +
sd.sdp + "'");
}
else {
alert("No remote session yet.");
}
| 规范 | 状态 | 注释 |
|---|---|---|
|
WebRTC 1.0: Real-time Communication Between Browsers
The definition of 'RTCPeerConnection.remoteDescription' in that specification. |
候选推荐 | 最初的规范。 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
remoteDescription
|
Chrome 24 | Edge 15 | Firefox 22 | IE No |
Opera
43
|
Safari 11 | WebView Android Yes | Chrome Android Yes | Firefox Android 44 |
Opera Android
43
|
Safari iOS Yes | Samsung Internet Android 6.0 |
完整支持
不支持
见实现注意事项。
RTCPeerConnection.setRemoteDescription()
,
RTCPeerConnection.pendingRemoteDescription
,
RTCPeerConnection.currentRemoteDescription
RTCPeerConnection.setLocalDescription()
,
RTCPeerConnection.pendingLocalDescription
,
RTCPeerConnection.currentLocalDescription
,
RTCPeerConnection.localDescription
RTCPeerConnection
canTrickleIceCandidates
connectionState
currentLocalDescription
currentRemoteDescription
getDefaultIceServers()
iceConnectionState
iceGatheringState
localDescription
onaddstream
onconnectionstatechange
ondatachannel
onicecandidate
oniceconnectionstatechange
onicegatheringstatechange
onidentityresult
onidpassertionerror
onidpvalidationerror
onnegotiationneeded
onpeeridentity
onremovestream
onsignalingstatechange
ontrack
peerIdentity
pendingLocalDescription
pendingRemoteDescription
remoteDescription
sctp
signalingState
addIceCandidate()
addStream()
addTrack()
close()
createAnswer()
createDataChannel()
createOffer()
generateCertificate()
getConfiguration()
getIdentityAssertion()
getReceivers()
getSenders()
getStats()
getStreamById()
getTransceivers()
removeStream()
removeTrack()
restartIce()
setConfiguration()
setIdentityProvider()
setLocalDescription()
setRemoteDescription()
MediaDevices.getUserMedia()
Navigator.mediaDevices
RTCCertificate
RTCDTMFSender
RTCDTMFToneChangeEvent
RTCDataChannel
RTCDataChannelEvent
RTCDtlsTransport
RTCErrorEvent
RTCIceCandidate
RTCIceTransport
RTCPeerConnectionIceErrorEvent
RTCPeerConnectionIceEvent
RTCRtpReceiver
RTCRtpSender
RTCRtpTransceiver
RTCSctpTransport
RTCSessionDescription
RTCStatsEvent
RTCStatsReport
RTCTrackEvent