|
1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this file, |
|
4 * You can obtain one at http://mozilla.org/MPL/2.0/. |
|
5 */ |
|
6 |
|
7 interface nsISupports; |
|
8 |
|
9 [ChromeOnly, |
|
10 JSImplementation="@mozilla.org/dom/peerconnectionobserver;1", |
|
11 Constructor (mozRTCPeerConnection domPC)] |
|
12 interface PeerConnectionObserver |
|
13 { |
|
14 /* JSEP callbacks */ |
|
15 void onCreateOfferSuccess(DOMString offer); |
|
16 void onCreateOfferError(unsigned long name, DOMString message); |
|
17 void onCreateAnswerSuccess(DOMString answer); |
|
18 void onCreateAnswerError(unsigned long name, DOMString message); |
|
19 void onSetLocalDescriptionSuccess(); |
|
20 void onSetRemoteDescriptionSuccess(); |
|
21 void onSetLocalDescriptionError(unsigned long name, DOMString message); |
|
22 void onSetRemoteDescriptionError(unsigned long name, DOMString message); |
|
23 void onAddIceCandidateSuccess(); |
|
24 void onAddIceCandidateError(unsigned long name, DOMString message); |
|
25 void onIceCandidate(unsigned short level, DOMString mid, DOMString candidate); |
|
26 |
|
27 /* Stats callbacks */ |
|
28 void onGetStatsSuccess(optional RTCStatsReportInternal report); |
|
29 void onGetStatsError(unsigned long name, DOMString message); |
|
30 |
|
31 /* Data channel callbacks */ |
|
32 void notifyDataChannel(DataChannel channel); |
|
33 void notifyConnection(); |
|
34 void notifyClosedConnection(); |
|
35 |
|
36 /* Notification of one of several types of state changed */ |
|
37 void onStateChange(PCObserverStateType state); |
|
38 |
|
39 /* Changes to MediaStreams */ |
|
40 void onAddStream(MediaStream stream); |
|
41 void onRemoveStream(); |
|
42 void onAddTrack(); |
|
43 void onRemoveTrack(); |
|
44 |
|
45 /* Helper function to access supported constraints defined in webidl. Needs to |
|
46 * be in a separate webidl object we hold, so putting it here was convenient. |
|
47 */ |
|
48 MediaConstraintSet getSupportedConstraints(optional MediaConstraintSet constraints); |
|
49 }; |