blob: 88c924f969ae9814b545d0be54e85a3f4cc058ac (
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
|
---
title: RTCDataChannelEvent.channel
slug: Web/API/RTCDataChannelEvent/channel
translation_of: Web/API/RTCDataChannelEvent/channel
---
<p>{{APIRef("WebRTC")}}{{SeeCompatTable}}</p>
<p>읽기 속성인 <code><strong>RTCDataChannelEvent</strong></code><strong><code>.channel</code></strong>는 {{domxref("RTCDataChannel")}}와 관련이 있는 이벤트를 반환합니다.</p>
<h2 id="Syntax">Syntax</h2>
<pre class="syntaxbox"> var <em>channel</em> = <em>RTCDataChannelEvent</em>.channel;</pre>
<h3 id="값">값</h3>
<p>{{domxref("RTCDataChannel")}} 객체는 {{domxref("RTCPeerConnection")}}을 원격 피어와 연결해주는 데이터 채널을 알려줍니다.</p>
<h2 id="예시">예시</h2>
<p>{{event("datachannel")}} 이벤트 핸들러 안 코드의 첫 줄에서 이벤트 객체의 채널을 가져오고, 이를 데이터 트래픽을 관리하는 코드에 사용 될 수 있도록 지역 변수로 저장합니다.</p>
<pre class="brush: js">pc.ondatachannel = function(event) {
inboundDataChannel = event.channel;
inboundDataChannel.onmessage = handleIncomingMessage;
inboundDataChannel.onopen = handleChannelOpen;
inboundDataChannel.onclose = handleChannelClose;
}
</pre>
<h2 id="Specifications" name="Specifications">명세</h2>
<table class="standard-table">
<thead>
<tr>
<th scope="col">명세</th>
<th scope="col">상태</th>
<th scope="col">코멘트</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ SpecName('WebRTC 1.0', '#dom-RTCDataChannelEvent-channel', 'RTCDataChannelEvent.channel') }}</td>
<td>{{ Spec2('WebRTC 1.0') }}</td>
<td>Initial specification.</td>
</tr>
</tbody>
</table>
<h2 id="브라우저_호환성">브라우저 호환성</h2>
<p>{{Compat("api.RTCDataChannelEvent.channel")}}</p>
<h2 id="See_also">See also</h2>
<ul>
<li>{{event("datachannel")}}</li>
<li>{{domxref("RTCDataChannel")}}</li>
<li>{{domxref("RTCPeerConnection.ondatachannel")}}</li>
<li><a href="/en-US/docs/Web/API/WebRTC_API/Simple_RTCDataChannel_sample">A simple RTCDataChannel sample</a></li>
<li>{{domxref("RTCPeerConnection")}}</li>
</ul>
|