From 4f4d511f3a78d7e3dc357e44481cf0a7eba99b9f Mon Sep 17 00:00:00 2001 From: MDN Date: Thu, 17 Mar 2022 00:12:44 +0000 Subject: [CRON] sync translated content --- .../connectionstatechange_event/index.html | 66 +++++++++++++++++++ .../rtcpeerconnection/datachannel_event/index.html | 63 ++++++++++++++++++ .../icecandidate_event/index.html | 64 ++++++++++++++++++ .../onconnectionstatechange/index.html | 65 ------------------ .../api/rtcpeerconnection/ondatachannel/index.html | 62 ------------------ .../rtcpeerconnection/onicecandidate/index.html | 63 ------------------ .../onicegatheringstatechange/index.html | 76 ---------------------- .../web/api/rtcpeerconnection/ontrack/index.html | 63 ------------------ .../api/rtcpeerconnection/track_event/index.html | 64 ++++++++++++++++++ .../web/api/serviceworker/onstatechange/index.html | 72 -------------------- .../api/serviceworker/statechange_event/index.html | 73 +++++++++++++++++++++ 11 files changed, 330 insertions(+), 401 deletions(-) create mode 100644 files/ko/web/api/rtcpeerconnection/connectionstatechange_event/index.html create mode 100644 files/ko/web/api/rtcpeerconnection/datachannel_event/index.html create mode 100644 files/ko/web/api/rtcpeerconnection/icecandidate_event/index.html delete mode 100644 files/ko/web/api/rtcpeerconnection/onconnectionstatechange/index.html delete mode 100644 files/ko/web/api/rtcpeerconnection/ondatachannel/index.html delete mode 100644 files/ko/web/api/rtcpeerconnection/onicecandidate/index.html delete mode 100644 files/ko/web/api/rtcpeerconnection/onicegatheringstatechange/index.html delete mode 100644 files/ko/web/api/rtcpeerconnection/ontrack/index.html create mode 100644 files/ko/web/api/rtcpeerconnection/track_event/index.html delete mode 100644 files/ko/web/api/serviceworker/onstatechange/index.html create mode 100644 files/ko/web/api/serviceworker/statechange_event/index.html (limited to 'files/ko/web') diff --git a/files/ko/web/api/rtcpeerconnection/connectionstatechange_event/index.html b/files/ko/web/api/rtcpeerconnection/connectionstatechange_event/index.html new file mode 100644 index 0000000000..3547500e7b --- /dev/null +++ b/files/ko/web/api/rtcpeerconnection/connectionstatechange_event/index.html @@ -0,0 +1,66 @@ +--- +title: RTCPeerConnection.onconnectionstatechange +slug: Web/API/RTCPeerConnection/connectionstatechange_event +translation_of: Web/API/RTCPeerConnection/onconnectionstatechange +original_slug: Web/API/RTCPeerConnection/onconnectionstatechange +--- +

{{APIRef("WebRTC")}}

+ +

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

+ +

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")}}

+ +

참조

+ + diff --git a/files/ko/web/api/rtcpeerconnection/datachannel_event/index.html b/files/ko/web/api/rtcpeerconnection/datachannel_event/index.html new file mode 100644 index 0000000000..706ebca78f --- /dev/null +++ b/files/ko/web/api/rtcpeerconnection/datachannel_event/index.html @@ -0,0 +1,63 @@ +--- +title: RTCPeerConnection.ondatachannel +slug: Web/API/RTCPeerConnection/datachannel_event +translation_of: Web/API/RTCPeerConnection/ondatachannel +original_slug: Web/API/RTCPeerConnection/ondatachannel +--- +

{{APIRef("WebRTC")}}{{SeeCompatTable}}

+ +

RTCPeerConnection.ondatachannel 속성은 {{domxref("RTCPeerConnection")}}에서 발생하는 {{event("datachannel")}} 이벤트에 의해 호출되는 {{event("Event_handlers", "event handler")}}입니다. 이 속성에는 함수를 정의하게됩니다. {{domxref("RTCDataChannelEvent")}}의 한 종류인 이 이벤트는 원격 유저가 {{domxref("RTCPeerConnection.createDataChannel", "createDataChannel()")}}를 호출해서 연결에 {{domxref("RTCDataChannel")}}가 추가되었을 때, 전달됩니다. 

+ +

이 이벤트를 수신하게되는 시점에서는 {{domxref("RTCDataChannel")}}가 아직 열리지 않았을 수 있습니다. 사용하기 전에 꼭 신규 RTCDataChannel"open"이벤트가 발생하는 것을 확인하십시오.

+ +

Syntax

+ +
RTCPeerConnection.ondatachannel = function;
+
+ +

+ +

이 속성에 지정하는 함수는 단일 패러미터를 입력 인자로 받습니다. channel 속성에 생성된 {{domxref("RTCDataChannel")}}를 제공하는 {{domxref("RTCDataChannelEvent")}} 입니다. 

+ +

예시

+ +
pc.ondatachannel = function(ev) {
+  console.log('Data channel is created!');
+  ev.channel.onopen = function() {
+    console.log('Data channel is open and ready to be used.');
+  };
+};
+
+ +

명세

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

브라우저 호환성

+ + + +

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

+ +

참조

+ + diff --git a/files/ko/web/api/rtcpeerconnection/icecandidate_event/index.html b/files/ko/web/api/rtcpeerconnection/icecandidate_event/index.html new file mode 100644 index 0000000000..4a74784411 --- /dev/null +++ b/files/ko/web/api/rtcpeerconnection/icecandidate_event/index.html @@ -0,0 +1,64 @@ +--- +title: RTCPeerConnection.onicecandidate +slug: Web/API/RTCPeerConnection/icecandidate_event +translation_of: Web/API/RTCPeerConnection/onicecandidate +original_slug: Web/API/RTCPeerConnection/onicecandidate +--- +

{{APIRef("WebRTC")}}

+ +

 RTCPeerConnection 속성의 {{domxref("RTCPeerConnection.onicecandidate", "onicecandidate")}} 는 {{domxref("RTCPeerConnection")}} 인스턴스에서 {{event("icecandidate")}} 이벤트 발생시에 호출 하려는 함수를 지정합니다. 이 이벤트는 로컬 {{Glossary("ICE")}} 에이전트가 signaling 서버를 통해 원격 피어에게 메세지를 전달 할 필요가 있을때 마다 발생합니다. 그리고 ICE 에이전트가 signaling에 사용되는 기술에 대한 구체사항을 모르더라도 원격 피어와의 네고시에이션을 수행하도록 도와줍니다. 어떤 메세징 기술을 선택하던간에, 이 메소드를 사용해서 원격 피어에 ICE candidate를 전달하는 과정을 간단하게 구현 할 수 있습니다. 

+ +

Syntax

+ +
RTCPeerConnection.onicecandidate = eventHandler;
+
+ +

+ +

onicecandidate 속성은 {{event("icecandidate")}} 이벤트를 나타내는 {{domxref("RTCPeerConnectionIceEvent")}} 객체를 입력 값으로 받는 함수로 설정되어야합니다. 여기에 설정되는 함수는 ICE candidate를 signaling 서버를 통해 원격 피어에게 전달해야합니다. 이때, ICE candidate의 {{Glossary("SDP")}}는 이벤트의 {{domxref("RTCPeerConnectionIceEvent.candidate", "candidate")}} 속성에서 확인 할 수 있습니다. 만약 이벤트의 candidate 속성이 null로 지정되어있다면, ICE 수집과정이 완료됩니다. 이 메세지는 원격 피어에 전달되지 않아야합니다. 이때, 연결의 {{domxref("RTCPeerConnection.iceGatheringState", "iceGatheringState")}} 또한 complete로 바뀌게 됩니다. ICE 수집 상태를 명시적으로 감시할 필요는 없습니다. 다만, signaling의 종료를 감지해야 한다면, ICE 네고시에이션이 complete 상태로 변한것을 알려주는 {{domxref("RTCPeerConnection.icegatheringstatechange_event", "icegatheringstatechange")}} 이벤트를 감시하면 됩니다.

+ +

예시

+ +

아래는 Signaling and video calling 문서의 코드를 기반으로 원격 피어에게 ICE candidate를 전달하는 {{event("icecandidate")}} 이벤트에 대한 핸들러를 설정합니다.

+ +
pc.onicecandidate = function(event) {
+  if (event.candidate) {
+    // event.candidate가 존재하면 원격 유저에게 candidate를 전달합니다.
+  } else {
+    // 모든 ICE candidate가 원격 유저에게 전달된 조건에서 실행됩니다.
+    // candidate = null
+  }
+}
+ +

위에서 알 수 있듯이, 이벤트의 {{domxref("RTCPeerConnectionIceEvent.candidate", "candidate")}} 속성이 null이면 네고시에이션의 종료가 감지됩니다. 

+ +

명세

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

브라우저 호환성

+ + + +

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

+ +

참조

+ + diff --git a/files/ko/web/api/rtcpeerconnection/onconnectionstatechange/index.html b/files/ko/web/api/rtcpeerconnection/onconnectionstatechange/index.html deleted file mode 100644 index a152ddf080..0000000000 --- a/files/ko/web/api/rtcpeerconnection/onconnectionstatechange/index.html +++ /dev/null @@ -1,65 +0,0 @@ ---- -title: RTCPeerConnection.onconnectionstatechange -slug: Web/API/RTCPeerConnection/onconnectionstatechange -translation_of: Web/API/RTCPeerConnection/onconnectionstatechange ---- -

{{APIRef("WebRTC")}}

- -

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

- -

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")}}

- -

참조

- - diff --git a/files/ko/web/api/rtcpeerconnection/ondatachannel/index.html b/files/ko/web/api/rtcpeerconnection/ondatachannel/index.html deleted file mode 100644 index e93e2e4f14..0000000000 --- a/files/ko/web/api/rtcpeerconnection/ondatachannel/index.html +++ /dev/null @@ -1,62 +0,0 @@ ---- -title: RTCPeerConnection.ondatachannel -slug: Web/API/RTCPeerConnection/ondatachannel -translation_of: Web/API/RTCPeerConnection/ondatachannel ---- -

{{APIRef("WebRTC")}}{{SeeCompatTable}}

- -

RTCPeerConnection.ondatachannel 속성은 {{domxref("RTCPeerConnection")}}에서 발생하는 {{event("datachannel")}} 이벤트에 의해 호출되는 {{event("Event_handlers", "event handler")}}입니다. 이 속성에는 함수를 정의하게됩니다. {{domxref("RTCDataChannelEvent")}}의 한 종류인 이 이벤트는 원격 유저가 {{domxref("RTCPeerConnection.createDataChannel", "createDataChannel()")}}를 호출해서 연결에 {{domxref("RTCDataChannel")}}가 추가되었을 때, 전달됩니다. 

- -

이 이벤트를 수신하게되는 시점에서는 {{domxref("RTCDataChannel")}}가 아직 열리지 않았을 수 있습니다. 사용하기 전에 꼭 신규 RTCDataChannel"open"이벤트가 발생하는 것을 확인하십시오.

- -

Syntax

- -
RTCPeerConnection.ondatachannel = function;
-
- -

- -

이 속성에 지정하는 함수는 단일 패러미터를 입력 인자로 받습니다. channel 속성에 생성된 {{domxref("RTCDataChannel")}}를 제공하는 {{domxref("RTCDataChannelEvent")}} 입니다. 

- -

예시

- -
pc.ondatachannel = function(ev) {
-  console.log('Data channel is created!');
-  ev.channel.onopen = function() {
-    console.log('Data channel is open and ready to be used.');
-  };
-};
-
- -

명세

- - - - - - - - - - - - - - - - -
명세상태코멘트
{{ SpecName('WebRTC 1.0', '#dom-rtcpeerconnection-ondatachannel', 'RTCPeerConnection.ondatachannel') }}{{ Spec2('WebRTC 1.0') }}Initial specification.
- -

브라우저 호환성

- - - -

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

- -

참조

- - diff --git a/files/ko/web/api/rtcpeerconnection/onicecandidate/index.html b/files/ko/web/api/rtcpeerconnection/onicecandidate/index.html deleted file mode 100644 index a8c23acfc1..0000000000 --- a/files/ko/web/api/rtcpeerconnection/onicecandidate/index.html +++ /dev/null @@ -1,63 +0,0 @@ ---- -title: RTCPeerConnection.onicecandidate -slug: Web/API/RTCPeerConnection/onicecandidate -translation_of: Web/API/RTCPeerConnection/onicecandidate ---- -

{{APIRef("WebRTC")}}

- -

 RTCPeerConnection 속성의 {{domxref("RTCPeerConnection.onicecandidate", "onicecandidate")}} 는 {{domxref("RTCPeerConnection")}} 인스턴스에서 {{event("icecandidate")}} 이벤트 발생시에 호출 하려는 함수를 지정합니다. 이 이벤트는 로컬 {{Glossary("ICE")}} 에이전트가 signaling 서버를 통해 원격 피어에게 메세지를 전달 할 필요가 있을때 마다 발생합니다. 그리고 ICE 에이전트가 signaling에 사용되는 기술에 대한 구체사항을 모르더라도 원격 피어와의 네고시에이션을 수행하도록 도와줍니다. 어떤 메세징 기술을 선택하던간에, 이 메소드를 사용해서 원격 피어에 ICE candidate를 전달하는 과정을 간단하게 구현 할 수 있습니다. 

- -

Syntax

- -
RTCPeerConnection.onicecandidate = eventHandler;
-
- -

- -

onicecandidate 속성은 {{event("icecandidate")}} 이벤트를 나타내는 {{domxref("RTCPeerConnectionIceEvent")}} 객체를 입력 값으로 받는 함수로 설정되어야합니다. 여기에 설정되는 함수는 ICE candidate를 signaling 서버를 통해 원격 피어에게 전달해야합니다. 이때, ICE candidate의 {{Glossary("SDP")}}는 이벤트의 {{domxref("RTCPeerConnectionIceEvent.candidate", "candidate")}} 속성에서 확인 할 수 있습니다. 만약 이벤트의 candidate 속성이 null로 지정되어있다면, ICE 수집과정이 완료됩니다. 이 메세지는 원격 피어에 전달되지 않아야합니다. 이때, 연결의 {{domxref("RTCPeerConnection.iceGatheringState", "iceGatheringState")}} 또한 complete로 바뀌게 됩니다. ICE 수집 상태를 명시적으로 감시할 필요는 없습니다. 다만, signaling의 종료를 감지해야 한다면, ICE 네고시에이션이 complete 상태로 변한것을 알려주는 {{domxref("RTCPeerConnection.icegatheringstatechange_event", "icegatheringstatechange")}} 이벤트를 감시하면 됩니다.

- -

예시

- -

아래는 Signaling and video calling 문서의 코드를 기반으로 원격 피어에게 ICE candidate를 전달하는 {{event("icecandidate")}} 이벤트에 대한 핸들러를 설정합니다.

- -
pc.onicecandidate = function(event) {
-  if (event.candidate) {
-    // event.candidate가 존재하면 원격 유저에게 candidate를 전달합니다.
-  } else {
-    // 모든 ICE candidate가 원격 유저에게 전달된 조건에서 실행됩니다.
-    // candidate = null
-  }
-}
- -

위에서 알 수 있듯이, 이벤트의 {{domxref("RTCPeerConnectionIceEvent.candidate", "candidate")}} 속성이 null이면 네고시에이션의 종료가 감지됩니다. 

- -

명세

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

브라우저 호환성

- - - -

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

- -

참조

- - diff --git a/files/ko/web/api/rtcpeerconnection/onicegatheringstatechange/index.html b/files/ko/web/api/rtcpeerconnection/onicegatheringstatechange/index.html deleted file mode 100644 index 9831c5057c..0000000000 --- a/files/ko/web/api/rtcpeerconnection/onicegatheringstatechange/index.html +++ /dev/null @@ -1,76 +0,0 @@ ---- -title: RTCPeerConnection.onicegatheringstatechange -slug: Web/API/RTCPeerConnection/onicegatheringstatechange -translation_of: Web/API/RTCPeerConnection/onicegatheringstatechange ---- -

{{APIRef("WebRTC")}}{{SeeCompatTable}}

- -

RTCPeerConnection.onicegatheringstatechange속성은 {{event("icegatheringstatechange")}} 이벤트가 {{domxref("RTCPeerConnection")}}에 전달될 때 호출이되는 함수를 정의하는 {{event("Event_handlers", "event handler")}}입니다. 이이벤트는 ICE 에이전트가 ICE candidate를 수집을 하는지의 여부를 알려주는 ICE 수집 상태가 변하면 발생합니다. 하지만, ICE 수집 상태를 모니터링 해야하는 특별한 이유가 없으면 이 이벤트를 감시 할 필요는 없습니다.

- -

Syntax

- -
RTCPeerConnection.onicegatheringstatechange = eventHandler;
-
- -

- -

{{event("icegatheringstatechange")}} 이벤트를 가진 {{domxref("Event")}} 객체를 단일 패러미터로 전달하는 함수를 제공합니다. {{domxref("RTCPeerConnection.iceGatheringState")}} 속성의 값 확인을 통해 ICE 수집 상태를 새로운 값으로 변경이 가능합니다.

- -

예시

- -

아래의 예제는 {{domxref("RTCPeerConnection.iceGatheringState", "iceGatheringState")}} 속성 값이 변할 때마다 현재 값을 확인하고, 수집 상태 변화에 맞추어 표시될 상태 내용을 업데이트해서 유저에게 알려줍니다.  

- -

이 상태는 {{HTMLElement("div")}} 요소에 텍스트로 표시됩니다.

- -
<div id="iceStatus"></div>
-
- -

예제에 사용된 이벤트 핸들러는 아래와 같습니다:

- -
pc.onicegatheringstatechange = function() {
-  let label = "Unknown";
-
-  switch(pc.iceGatheringState) {
-    case "new":
-    case "complete":
-      label = "Idle";
-      break;
-    case "gathering":
-      label = "Determining route";
-      break;
-  }
-  // HTML에서 id가 "iceStatus"인 요소에 label 값을 지정
-  document.getElementById("iceStatus").innerHTML = label;
-}
- -

명세

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

브라우저 호환성

- - - -

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

- -

참조

- - diff --git a/files/ko/web/api/rtcpeerconnection/ontrack/index.html b/files/ko/web/api/rtcpeerconnection/ontrack/index.html deleted file mode 100644 index d598a6194f..0000000000 --- a/files/ko/web/api/rtcpeerconnection/ontrack/index.html +++ /dev/null @@ -1,63 +0,0 @@ ---- -title: RTCPeerConnection.ontrack -slug: Web/API/RTCPeerConnection/ontrack -translation_of: Web/API/RTCPeerConnection/ontrack ---- -
{{APIRef("WebRTC")}}
- -

{{domxref("RTCPeerConnection")}} 속성인 ontrack은 {{domxref("RTCPeerConnection")}}에 트랙이 등록됨을 알려주는 {{event("track")}}가 발생하면 호출되는 함수를 지정하는 {{event("Event_handlers", "event handler")}}입니다.

- -

이 함수는 {{domxref("RTCTrackEvent")}} 타입의 이벤트 객체를 입력 인자로 받습니다. 해당 이벤트는 신규로 받아지는 {{domxref("MediaStreamTrack")}}가 생성되고 연결의 리시버 세트에 추가된 {{domxref("RTCRtpReceiver")}}객체와 연관되면 전송됩니다.

- -

Syntax

- -
RTCPeerConnection.ontrack = eventHandler;
-
- -

- -

ontrack을 함수로 지정해서 신규 트랙에 대해 설명하고 어떻게 사용 될지를 알려주는 {{domxref("RTCTrackEvent")}} 객체를 입력 인자로 받도록 하십시오. 이 정보에는 신규 트랙을 나타내는 {{domxref("MediaStreamTrack")}} 객체, {{domxref("RTCRtpReceiver")}}와{{domxref("RTCRtpTransceiver")}}, 그리고 트랙이 어느 스트림에 해당하는지를 알려주는 {{domxref("MediaStream")}}의 리스트 객체를 포함합니다. 

- -

예시

- -

아래의 예시는 Signaling and video calling 문서에 나온 코드의 일부입니다. 이 코드는 들어오는 트랙을 {{HTMLElement("video")}}에 연결해서 해당 비디오를 보여줄 수 있도록 합니다.

- -
pc.ontrack = function(event) {
-  document.getElementById("received_video").srcObject = event.streams[0];
-  document.getElementById("hangup-button").disabled = false;
-};
-
-
- -

첫 줄에 나온 ontrack 이벤트 핸들러는 들어오는 트랙의 첫 스트림을 가져다가 {{htmlattrxref("srcObject", "video")}} 속성에 지정합니다. 이렇게 함으로써 비디오의 스트림을 해당 요소에 연결하고, 유저에게 보여 줄 수 있게됩니다. 두 번째줄에서는 "통화 종료" 버튼을 활성화하여 유저가 통화를 종료 할 수 있도록 해줍니다.

- -

사양서

- - - - - - - - - - - - - - - - -
사양서상태코멘트
{{SpecName('WebRTC 1.0', '#widl-RTCPeerConnection-ontrack', 'RTCPeerConnection.ontrack')}}{{Spec2('WebRTC 1.0')}}Initial specification.
- -

브라우저 호환성

- - - -

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

- -

참조

- - diff --git a/files/ko/web/api/rtcpeerconnection/track_event/index.html b/files/ko/web/api/rtcpeerconnection/track_event/index.html new file mode 100644 index 0000000000..e3449ede3b --- /dev/null +++ b/files/ko/web/api/rtcpeerconnection/track_event/index.html @@ -0,0 +1,64 @@ +--- +title: RTCPeerConnection.ontrack +slug: Web/API/RTCPeerConnection/track_event +translation_of: Web/API/RTCPeerConnection/ontrack +original_slug: Web/API/RTCPeerConnection/ontrack +--- +
{{APIRef("WebRTC")}}
+ +

{{domxref("RTCPeerConnection")}} 속성인 ontrack은 {{domxref("RTCPeerConnection")}}에 트랙이 등록됨을 알려주는 {{event("track")}}가 발생하면 호출되는 함수를 지정하는 {{event("Event_handlers", "event handler")}}입니다.

+ +

이 함수는 {{domxref("RTCTrackEvent")}} 타입의 이벤트 객체를 입력 인자로 받습니다. 해당 이벤트는 신규로 받아지는 {{domxref("MediaStreamTrack")}}가 생성되고 연결의 리시버 세트에 추가된 {{domxref("RTCRtpReceiver")}}객체와 연관되면 전송됩니다.

+ +

Syntax

+ +
RTCPeerConnection.ontrack = eventHandler;
+
+ +

+ +

ontrack을 함수로 지정해서 신규 트랙에 대해 설명하고 어떻게 사용 될지를 알려주는 {{domxref("RTCTrackEvent")}} 객체를 입력 인자로 받도록 하십시오. 이 정보에는 신규 트랙을 나타내는 {{domxref("MediaStreamTrack")}} 객체, {{domxref("RTCRtpReceiver")}}와{{domxref("RTCRtpTransceiver")}}, 그리고 트랙이 어느 스트림에 해당하는지를 알려주는 {{domxref("MediaStream")}}의 리스트 객체를 포함합니다. 

+ +

예시

+ +

아래의 예시는 Signaling and video calling 문서에 나온 코드의 일부입니다. 이 코드는 들어오는 트랙을 {{HTMLElement("video")}}에 연결해서 해당 비디오를 보여줄 수 있도록 합니다.

+ +
pc.ontrack = function(event) {
+  document.getElementById("received_video").srcObject = event.streams[0];
+  document.getElementById("hangup-button").disabled = false;
+};
+
+
+ +

첫 줄에 나온 ontrack 이벤트 핸들러는 들어오는 트랙의 첫 스트림을 가져다가 {{htmlattrxref("srcObject", "video")}} 속성에 지정합니다. 이렇게 함으로써 비디오의 스트림을 해당 요소에 연결하고, 유저에게 보여 줄 수 있게됩니다. 두 번째줄에서는 "통화 종료" 버튼을 활성화하여 유저가 통화를 종료 할 수 있도록 해줍니다.

+ +

사양서

+ + + + + + + + + + + + + + + + +
사양서상태코멘트
{{SpecName('WebRTC 1.0', '#widl-RTCPeerConnection-ontrack', 'RTCPeerConnection.ontrack')}}{{Spec2('WebRTC 1.0')}}Initial specification.
+ +

브라우저 호환성

+ + + +

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

+ +

참조

+ + diff --git a/files/ko/web/api/serviceworker/onstatechange/index.html b/files/ko/web/api/serviceworker/onstatechange/index.html deleted file mode 100644 index d6063f0445..0000000000 --- a/files/ko/web/api/serviceworker/onstatechange/index.html +++ /dev/null @@ -1,72 +0,0 @@ ---- -title: ServiceWorker.onstatechange -slug: Web/API/ServiceWorker/onstatechange -translation_of: Web/API/ServiceWorker/onstatechange ---- -
{{SeeCompatTable}}{{APIRef("Service Workers API")}}
- -

statechange 타입의 이벤트가 발생될 때마다 호출되는 {{domxref("EventListener")}} 속성. 기본적으로 {{domxref("ServiceWorker.state")}}가 변경되는 시점에 발생한다.

- -

Syntax

- -
ServiceWorker.onstatechange = function(statechangeevent) { ... }
-ServiceWorker.addEventListener('statechange', function(statechangeevent) { ... } )
- -

Examples

- -

이 코드 조각은 service worker registration-events sample (live demo) 으로부터 가져온 것이다. 이 코드는 {{domxref("ServiceWorker.state")}}의 모든 변경 사항을 수신하고 그 값을 반환한다.

- -
var serviceWorker;
-if (registration.installing) {
-  serviceWorker = registration.installing;
-  document.querySelector('#kind').textContent = 'installing';
-} else if (registration.waiting) {
-  serviceWorker = registration.waiting;
-  document.querySelector('#kind').textContent = 'waiting';
-} else if (registration.active) {
-  serviceWorker = registration.active;
-  document.querySelector('#kind').textContent = 'active';
-}
-
-if (serviceWorker) {
-  logState(serviceWorker.state);
-  serviceWorker.addEventListener('statechange', function(e) {
-  logState(e.target.state);
-  });
-}
- -

statechange 가 발생할 때, 서비스워커의 참조들이 변화할 수 있으므로 주의하라. 예시:

- -
navigator.serviceWorker.register(..).then(function(swr) {
-  swr.installing.state == "installing"
-  swr.installing.onstatechange = function() {
-    swr.installing == null;
-    // 이 시점에서, swr.waiting 또는 swr.active는 true일 것이다. 이것은 statechange 이벤트가 대기 상태이기 때문이며,
-    // 그동안 잠재 상태의 워커가 waiting 상태가 될 수도 있으며 가능한 경우에는 즉시 activated 될 것이다.
-  }
-})
- -

Specifications

- - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('Service Workers', '#service-worker-onstatechange-attribute', 'ServiceWorker.onstatechange')}}{{Spec2('Service Workers')}}Initial definition
- -

Browser compatibility

- -
- - -

{{Compat("api.ServiceWorker.onstatechange")}}

-
diff --git a/files/ko/web/api/serviceworker/statechange_event/index.html b/files/ko/web/api/serviceworker/statechange_event/index.html new file mode 100644 index 0000000000..aebeda7895 --- /dev/null +++ b/files/ko/web/api/serviceworker/statechange_event/index.html @@ -0,0 +1,73 @@ +--- +title: ServiceWorker.onstatechange +slug: Web/API/ServiceWorker/statechange_event +translation_of: Web/API/ServiceWorker/onstatechange +original_slug: Web/API/ServiceWorker/onstatechange +--- +
{{SeeCompatTable}}{{APIRef("Service Workers API")}}
+ +

statechange 타입의 이벤트가 발생될 때마다 호출되는 {{domxref("EventListener")}} 속성. 기본적으로 {{domxref("ServiceWorker.state")}}가 변경되는 시점에 발생한다.

+ +

Syntax

+ +
ServiceWorker.onstatechange = function(statechangeevent) { ... }
+ServiceWorker.addEventListener('statechange', function(statechangeevent) { ... } )
+ +

Examples

+ +

이 코드 조각은 service worker registration-events sample (live demo) 으로부터 가져온 것이다. 이 코드는 {{domxref("ServiceWorker.state")}}의 모든 변경 사항을 수신하고 그 값을 반환한다.

+ +
var serviceWorker;
+if (registration.installing) {
+  serviceWorker = registration.installing;
+  document.querySelector('#kind').textContent = 'installing';
+} else if (registration.waiting) {
+  serviceWorker = registration.waiting;
+  document.querySelector('#kind').textContent = 'waiting';
+} else if (registration.active) {
+  serviceWorker = registration.active;
+  document.querySelector('#kind').textContent = 'active';
+}
+
+if (serviceWorker) {
+  logState(serviceWorker.state);
+  serviceWorker.addEventListener('statechange', function(e) {
+  logState(e.target.state);
+  });
+}
+ +

statechange 가 발생할 때, 서비스워커의 참조들이 변화할 수 있으므로 주의하라. 예시:

+ +
navigator.serviceWorker.register(..).then(function(swr) {
+  swr.installing.state == "installing"
+  swr.installing.onstatechange = function() {
+    swr.installing == null;
+    // 이 시점에서, swr.waiting 또는 swr.active는 true일 것이다. 이것은 statechange 이벤트가 대기 상태이기 때문이며,
+    // 그동안 잠재 상태의 워커가 waiting 상태가 될 수도 있으며 가능한 경우에는 즉시 activated 될 것이다.
+  }
+})
+ +

Specifications

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('Service Workers', '#service-worker-onstatechange-attribute', 'ServiceWorker.onstatechange')}}{{Spec2('Service Workers')}}Initial definition
+ +

Browser compatibility

+ +
+ + +

{{Compat("api.ServiceWorker.onstatechange")}}

+
-- cgit v1.2.3-54-g00ecf