PeerConnectionObserver.webidl (1859B)
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 dictionary PCErrorData 10 { 11 required PCError name; 12 required DOMString message; 13 // Will need to add more stuff (optional) for RTCError 14 }; 15 16 [ChromeOnly, 17 JSImplementation="@mozilla.org/dom/peerconnectionobserver;1", 18 Exposed=Window] 19 interface PeerConnectionObserver 20 { 21 [Throws] 22 constructor(RTCPeerConnection domPC); 23 24 /* JSEP callbacks */ 25 undefined onCreateOfferSuccess(DOMString offer); 26 undefined onCreateOfferError(PCErrorData error); 27 undefined onCreateAnswerSuccess(DOMString answer); 28 undefined onCreateAnswerError(PCErrorData error); 29 undefined onSetDescriptionSuccess(); 30 undefined onSetDescriptionError(PCErrorData error); 31 undefined onAddIceCandidateSuccess(); 32 undefined onAddIceCandidateError(PCErrorData error); 33 undefined onIceCandidate(unsigned short level, DOMString mid, DOMString candidate, DOMString ufrag); 34 35 /* Data channel callbacks */ 36 undefined notifyDataChannel(RTCDataChannel channel); 37 38 /* Notification of one of several types of state changed */ 39 undefined onStateChange(PCObserverStateType state); 40 41 /* 42 Lets PeerConnectionImpl fire track events on the RTCPeerConnection 43 */ 44 undefined fireTrackEvent(RTCRtpReceiver receiver, sequence<MediaStream> streams); 45 46 /* 47 Lets PeerConnectionImpl fire addstream events on the RTCPeerConnection 48 */ 49 undefined fireStreamEvent(MediaStream stream); 50 51 undefined fireNegotiationNeededEvent(); 52 53 /* Packet dump callback */ 54 undefined onPacket(unsigned long level, mozPacketDumpType type, boolean sending, 55 ArrayBuffer packet); 56 };