RTCPeerConnection: pendingRemoteDescription 屬性
pendingRemoteDescription 是 介面的一個只讀屬性,它返回一個 RTCPeerConnection 物件,該物件描述了連線遠端端點的一個待處理的配置更改。RTCSessionDescription
這並不描述連線當前的狀態,而是描述連線在不久的將來可能的狀態。使用 RTCPeerConnection.currentRemoteDescription 或 RTCPeerConnection.remoteDescription 來獲取遠端端點的當前會話描述。有關它們之間區別的詳細資訊,請參閱 WebRTC 連線頁面中的 待處理和當前描述。
值
如果遠端描述更改正在進行中,則這是一個描述提議配置的 物件。否則,返回 RTCSessionDescriptionnull。
示例
此示例檢查 pendingRemoteDescription 以確定是否正在處理描述更改。
js
const pc = new RTCPeerConnection();
// …
const sd = pc.pendingRemoteDescription;
if (sd) {
// There's a description change underway!
} else {
// No description change pending
}
規範
| 規範 |
|---|
| WebRTC:瀏覽器中的即時通訊 # dom-peerconnection-pendingremotedesc |
瀏覽器相容性
載入中…
注意: pendingRemoteDescription 和 currentRemoteDescription 新增到 WebRTC 規範中是相對較新的。在不支援它們的瀏覽器中,只有 remoteDescription 可用。