|
1 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
2 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
4 |
|
5 enum RTCDataChannelState { |
|
6 "connecting", |
|
7 "open", |
|
8 "closing", |
|
9 "closed" |
|
10 }; |
|
11 |
|
12 enum RTCDataChannelType { |
|
13 "arraybuffer", |
|
14 "blob" |
|
15 }; |
|
16 |
|
17 // XXX This interface is called RTCDataChannel in the spec. |
|
18 interface DataChannel : EventTarget |
|
19 { |
|
20 readonly attribute DOMString label; |
|
21 readonly attribute boolean reliable; |
|
22 readonly attribute RTCDataChannelState readyState; |
|
23 readonly attribute unsigned long bufferedAmount; |
|
24 attribute EventHandler onopen; |
|
25 attribute EventHandler onerror; |
|
26 attribute EventHandler onclose; |
|
27 void close(); |
|
28 attribute EventHandler onmessage; |
|
29 attribute RTCDataChannelType binaryType; |
|
30 [Throws] |
|
31 void send(DOMString data); |
|
32 [Throws] |
|
33 void send(Blob data); |
|
34 [Throws] |
|
35 void send(ArrayBuffer data); |
|
36 [Throws] |
|
37 void send(ArrayBufferView data); |
|
38 }; |
|
39 |
|
40 // Mozilla extensions. |
|
41 partial interface DataChannel |
|
42 { |
|
43 readonly attribute DOMString protocol; |
|
44 readonly attribute boolean ordered; |
|
45 readonly attribute unsigned short id; |
|
46 // this is deprecated due to renaming in the spec, but still supported for Fx22 |
|
47 readonly attribute unsigned short stream; // now id |
|
48 }; |