michael@0: /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: */ michael@0: michael@0: interface nsISupports; michael@0: michael@0: [ChromeOnly, michael@0: JSImplementation="@mozilla.org/dom/peerconnectionobserver;1", michael@0: Constructor (mozRTCPeerConnection domPC)] michael@0: interface PeerConnectionObserver michael@0: { michael@0: /* JSEP callbacks */ michael@0: void onCreateOfferSuccess(DOMString offer); michael@0: void onCreateOfferError(unsigned long name, DOMString message); michael@0: void onCreateAnswerSuccess(DOMString answer); michael@0: void onCreateAnswerError(unsigned long name, DOMString message); michael@0: void onSetLocalDescriptionSuccess(); michael@0: void onSetRemoteDescriptionSuccess(); michael@0: void onSetLocalDescriptionError(unsigned long name, DOMString message); michael@0: void onSetRemoteDescriptionError(unsigned long name, DOMString message); michael@0: void onAddIceCandidateSuccess(); michael@0: void onAddIceCandidateError(unsigned long name, DOMString message); michael@0: void onIceCandidate(unsigned short level, DOMString mid, DOMString candidate); michael@0: michael@0: /* Stats callbacks */ michael@0: void onGetStatsSuccess(optional RTCStatsReportInternal report); michael@0: void onGetStatsError(unsigned long name, DOMString message); michael@0: michael@0: /* Data channel callbacks */ michael@0: void notifyDataChannel(DataChannel channel); michael@0: void notifyConnection(); michael@0: void notifyClosedConnection(); michael@0: michael@0: /* Notification of one of several types of state changed */ michael@0: void onStateChange(PCObserverStateType state); michael@0: michael@0: /* Changes to MediaStreams */ michael@0: void onAddStream(MediaStream stream); michael@0: void onRemoveStream(); michael@0: void onAddTrack(); michael@0: void onRemoveTrack(); michael@0: michael@0: /* Helper function to access supported constraints defined in webidl. Needs to michael@0: * be in a separate webidl object we hold, so putting it here was convenient. michael@0: */ michael@0: MediaConstraintSet getSupportedConstraints(optional MediaConstraintSet constraints); michael@0: };