aboutsummaryrefslogtreecommitdiff
path: root/files/pt-br/web/api/rtcpeerconnection/connectionstate/index.html
blob: 102b310ecd72108cf51636c7f3c29df90be87337 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
---
title: RTCPeerConnection.connectionState
slug: Web/API/RTCPeerConnection/connectionState
translation_of: Web/API/RTCPeerConnection/connectionState
---
<p>{{APIRef("WebRTC")}}</p>

<p>A propriedade <strong><code>connectionState</code></strong> do tipo somente leitura da interface {{domxref("RTCPeerConnection")}} indica o estado atual da conexão em par, devolvendo um valor em string específicado por um enum {{domxref("RTCPeerConnection")}}.</p>

<p>Quando o valor da propriedade muda, o evento {{event("connectionstatechange")}} é enviado para a intância {{domxref("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>O estado atual da conexão, como um valor do 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>