OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * |
| 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions |
| 6 * are met: |
| 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright |
| 11 * notice, this list of conditions and the following disclaimer |
| 12 * in the documentation and/or other materials provided with the |
| 13 * distribution. |
| 14 * 3. Neither the name of Google Inc. nor the names of its contributors |
| 15 * may be used to endorse or promote products derived from this |
| 16 * software without specific prior written permission. |
| 17 * |
| 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ |
| 30 |
| 31 module p2p { |
| 32 |
| 33 interface [ |
| 34 Conditional=MEDIA_STREAM, |
| 35 ActiveDOMObject, |
| 36 Constructor(in DOMString serverConfiguration, in [Callback] IceCallback
iceCallback), |
| 37 CallWith=ScriptExecutionContext, |
| 38 EventTarget |
| 39 ] PeerConnection00 { |
| 40 // FIXME: Make mediaHints an object |
| 41 SessionDescription createOffer(in [Optional] DOMString mediaHints); |
| 42 |
| 43 // FIXME: Make mediaHints an object |
| 44 SessionDescription createAnswer(in DOMString offer, in [Optional] DOMStr
ing mediaHints); |
| 45 |
| 46 // Actions, for setLocalDescription/setRemoteDescription. |
| 47 const unsigned short SDP_OFFER = 0x100; |
| 48 const unsigned short SDP_PRANSWER = 0x200; |
| 49 const unsigned short SDP_ANSWER = 0x300; |
| 50 |
| 51 void setLocalDescription(in unsigned short action, in SessionDescription
desc) |
| 52 raises(DOMException); |
| 53 |
| 54 void setRemoteDescription(in unsigned short action, in SessionDescriptio
n desc) |
| 55 raises(DOMException); |
| 56 |
| 57 readonly attribute SessionDescription localDescription; |
| 58 |
| 59 readonly attribute SessionDescription remoteDescription; |
| 60 |
| 61 const unsigned short NEW = 0; |
| 62 const unsigned short NEGOTIATING = 1; |
| 63 const unsigned short ACTIVE = 2; |
| 64 const unsigned short CLOSED = 3; |
| 65 readonly attribute unsigned short readyState; |
| 66 |
| 67 // FIXME: Make iceOptions an object |
| 68 void startIce(in [Optional] DOMString iceOptions) |
| 69 raises(DOMException); |
| 70 |
| 71 void processIceMessage(in IceCandidate candidate) |
| 72 raises(DOMException); |
| 73 |
| 74 const unsigned short ICE_GATHERING = 0x100; |
| 75 const unsigned short ICE_WAITING = 0x200; |
| 76 const unsigned short ICE_CHECKING = 0x300; |
| 77 const unsigned short ICE_CONNECTED = 0x400; |
| 78 const unsigned short ICE_COMPLETED = 0x500; |
| 79 const unsigned short ICE_FAILED = 0x600; |
| 80 const unsigned short ICE_CLOSED = 0x700; |
| 81 readonly attribute unsigned short iceState; |
| 82 |
| 83 // FIXME: Make mediaStreamHints an object |
| 84 [StrictTypeChecking] void addStream(in MediaStream stream, in [Optional]
DOMString mediaStreamHints) |
| 85 raises(DOMException); |
| 86 [StrictTypeChecking] void removeStream(in MediaStream stream) |
| 87 raises(DOMException); |
| 88 |
| 89 readonly attribute MediaStreamList localStreams; |
| 90 readonly attribute MediaStreamList remoteStreams; |
| 91 |
| 92 void close() |
| 93 raises(DOMException); |
| 94 |
| 95 attribute EventListener onconnecting; |
| 96 attribute EventListener onopen; |
| 97 attribute EventListener onstatechange; |
| 98 attribute EventListener onaddstream; |
| 99 attribute EventListener onremovestream; |
| 100 |
| 101 // EventTarget interface |
| 102 void addEventListener(in DOMString type, |
| 103 in EventListener listener, |
| 104 in [Optional] boolean useCapture); |
| 105 void removeEventListener(in DOMString type, |
| 106 in EventListener listener, |
| 107 in [Optional] boolean useCapture); |
| 108 boolean dispatchEvent(in Event event) |
| 109 raises(EventException); |
| 110 }; |
| 111 |
| 112 } |
OLD | NEW |