aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/rtcpeerconnection/connectionstate
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
commit33058f2b292b3a581333bdfb21b8f671898c5060 (patch)
tree51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/api/rtcpeerconnection/connectionstate
parent8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff)
downloadtranslated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip
initial commit
Diffstat (limited to 'files/zh-cn/web/api/rtcpeerconnection/connectionstate')
-rw-r--r--files/zh-cn/web/api/rtcpeerconnection/connectionstate/index.html64
1 files changed, 64 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/rtcpeerconnection/connectionstate/index.html b/files/zh-cn/web/api/rtcpeerconnection/connectionstate/index.html
new file mode 100644
index 0000000000..b61466213e
--- /dev/null
+++ b/files/zh-cn/web/api/rtcpeerconnection/connectionstate/index.html
@@ -0,0 +1,64 @@
+---
+title: RTCPeerConnection.connectionState
+slug: Web/API/RTCPeerConnection/connectionState
+translation_of: Web/API/RTCPeerConnection/connectionState
+---
+<p>{{APIRef("WebRTC")}}</p>
+
+<p> </p>
+
+<p><strong><code>connectionState 只读,说明当前连接状态。状态值参见</code></strong><code><a href="#RTCPeerConnectionState_enum">RTCPeerConnectionState</a></code><strong> ,值由一个peer connection返回。</strong></p>
+
+<p>值变化时,一个connectionstatechange 事件发送给RTCPeerConnection对象实例中。</p>
+
+<h2 id="Syntax">Syntax</h2>
+
+<pre class="syntaxbox">var <em>connectionState</em> = <em>RTCPeerConnection</em>.connectionState;</pre>
+
+<h3 id="Value">Value</h3>
+
+<p>The current state of the connection, as a value from the enum <code><a href="#RTCPeerConnectionState_enum">RTCPeerConnectionState</a></code>.</p>
+
+<p>{{page("/en-US/docs/Web/API/RTCPeerConnection", "RTCPeerConnectionState enum", 0, 1)}}</p>
+
+<h2 id="Example">Example</h2>
+
+<pre class="brush: js">var pc = new RTCPeerConnection(configuration);
+
+/* ... */
+
+var connectionState = pc.connectionState;</pre>
+
+<h2 id="Specifications">Specifications</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{ SpecName('WebRTC 1.0', '#widl-RTCPeerConnection-connectionState', 'RTCPeerConnection.connectionState') }}</td>
+ <td>{{ Spec2('WebRTC 1.0') }}</td>
+ <td>Initial specification.</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Browser_compatibility">Browser compatibility</h2>
+
+
+
+<p>{{Compat("api.RTCPeerConnection.connectionState")}}</p>
+
+<h2 id="See_also">See also</h2>
+
+<ul>
+ <li><a href="/en-US/docs/Web/API/WebRTC_API/Session_lifetime">Lifetime of a WebRTC session</a></li>
+ <li>{{domxref("RTCPeerConnection")}}</li>
+ <li>{{event("connectionstatechange")}}</li>
+ <li><a href="/en-US/docs/Web/Guide/API/WebRTC">WebRTC</a></li>
+</ul>