From da78a9e329e272dedb2400b79a3bdeebff387d47 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:42:17 -0500 Subject: initial commit --- .../onconnectionstatechange/index.html | 65 ++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 files/ko/web/api/rtcpeerconnection/onconnectionstatechange/index.html (limited to 'files/ko/web/api/rtcpeerconnection/onconnectionstatechange') diff --git a/files/ko/web/api/rtcpeerconnection/onconnectionstatechange/index.html b/files/ko/web/api/rtcpeerconnection/onconnectionstatechange/index.html new file mode 100644 index 0000000000..5505f509eb --- /dev/null +++ b/files/ko/web/api/rtcpeerconnection/onconnectionstatechange/index.html @@ -0,0 +1,65 @@ +--- +title: RTCPeerConnection.onconnectionstatechange +slug: Web/API/RTCPeerConnection/onconnectionstatechange +translation_of: Web/API/RTCPeerConnection/onconnectionstatechange +--- +

{{APIRef("WebRTC")}}

+ +

RTCPeerConnection.onconnectionstatechange 속성에 {{domxref("RTCPeerConnection")}} 인스턴스에서 발생하는 {{event("connectionstatechange")}} 이벤트를 처리하기 위해 호출되는 {{domxref("EventHandler")}}를 정의하게됩니다. 이 이벤트는  연결의 상태 집합체가 변할 때마다 발생합니다. 이 상태 집합체는 연결에 의해 사용되는 각각의 네트워크 전송 상태들의 묶음입니다.

+ +

Syntax

+ +
RTCPeerConnection.onconnectionstatechange = eventHandler;
+
+ +

+ +

{{domxref("RTCPeerConnection")}}에서 {{event("connectionstatechange")}} 이벤트가 생길 때, 브라우저에 의해 호출되는 함수입니다. 이 함수는 {{domxref("Event")}} 타입의 객체인 단일 패러미터를 입력인자로 받습니다. 해당 이벤트 객체는 특별한 정보를 담고 있지는 않습니다. 새로운 상태를 확인하려면 피어 연결의 {{domxref("RTCPeerConnection.connectionState", "connectionState")}}에 해당하는 값을 살펴보십시오. 

+ +

예시

+ +
pc.onconnectionstatechange = function(event) {
+  switch(pc.connectionState) {
+    case "connected":
+      // The connection has become fully connected
+      break;
+    case "disconnected":
+    case "failed":
+      // One or more transports has terminated unexpectedly or in an error
+      break;
+    case "closed":
+      // The connection has been closed
+      break;
+  }
+}
+ +

명세

+ + + + + + + + + + + + + + + + +
명세상태코멘트
{{ SpecName('WebRTC 1.0', '#widl-RTCPeerConnection-onconnectionstatechange', 'RTCPeerConnection.onconnectionstatechange') }}{{ Spec2('WebRTC 1.0') }}Initial specification.
+ +

브라우저 호환성

+ + + +

{{Compat("api.RTCPeerConnection.onconnectionstatechange")}}

+ +

참조

+ + -- cgit v1.2.3-54-g00ecf