2018-09-13 23:04:55 +03:00
|
|
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2013-10-14 20:53:56 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*/
|
|
|
|
|
2013-10-19 20:21:06 +04:00
|
|
|
interface nsISupports;
|
|
|
|
|
2019-04-02 16:08:18 +03:00
|
|
|
dictionary PCErrorData
|
|
|
|
{
|
|
|
|
required PCError name;
|
|
|
|
required DOMString message;
|
|
|
|
// Will need to add more stuff (optional) for RTCError
|
|
|
|
};
|
|
|
|
|
2013-10-14 20:53:56 +04:00
|
|
|
[ChromeOnly,
|
2019-09-27 18:26:14 +03:00
|
|
|
JSImplementation="@mozilla.org/dom/peerconnectionobserver;1",
|
|
|
|
Exposed=Window]
|
2013-10-14 20:53:56 +04:00
|
|
|
interface PeerConnectionObserver
|
|
|
|
{
|
2019-09-12 14:01:17 +03:00
|
|
|
[Throws]
|
|
|
|
constructor(RTCPeerConnection domPC);
|
|
|
|
|
2013-10-14 20:53:56 +04:00
|
|
|
/* JSEP callbacks */
|
|
|
|
void onCreateOfferSuccess(DOMString offer);
|
2019-04-02 16:08:18 +03:00
|
|
|
void onCreateOfferError(PCErrorData error);
|
2013-10-14 20:53:56 +04:00
|
|
|
void onCreateAnswerSuccess(DOMString answer);
|
2019-04-02 16:08:18 +03:00
|
|
|
void onCreateAnswerError(PCErrorData error);
|
2020-02-06 18:50:03 +03:00
|
|
|
void onSetDescriptionSuccess();
|
|
|
|
void onSetDescriptionError(PCErrorData error);
|
2013-10-14 20:53:56 +04:00
|
|
|
void onAddIceCandidateSuccess();
|
2019-04-02 16:08:18 +03:00
|
|
|
void onAddIceCandidateError(PCErrorData error);
|
2019-03-08 18:24:27 +03:00
|
|
|
void onIceCandidate(unsigned short level, DOMString mid, DOMString candidate, DOMString ufrag);
|
2013-10-14 20:53:56 +04:00
|
|
|
|
|
|
|
/* Data channel callbacks */
|
2018-02-10 01:36:48 +03:00
|
|
|
void notifyDataChannel(RTCDataChannel channel);
|
2013-10-14 20:53:56 +04:00
|
|
|
|
|
|
|
/* Notification of one of several types of state changed */
|
|
|
|
void onStateChange(PCObserverStateType state);
|
|
|
|
|
2017-08-23 23:47:54 +03:00
|
|
|
/* Transceiver management; called when setRemoteDescription causes a
|
|
|
|
transceiver to be created on the C++ side */
|
|
|
|
void onTransceiverNeeded(DOMString kind, TransceiverImpl transceiverImpl);
|
2016-09-14 15:53:23 +03:00
|
|
|
|
2020-03-20 18:33:37 +03:00
|
|
|
/*
|
|
|
|
Lets PeerConnectionImpl fire track events on the RTCPeerConnection
|
|
|
|
*/
|
|
|
|
void fireTrackEvent(RTCRtpReceiver receiver, sequence<MediaStream> streams);
|
|
|
|
|
|
|
|
/*
|
|
|
|
Lets PeerConnectionImpl fire addstream events on the RTCPeerConnection
|
|
|
|
*/
|
|
|
|
void fireStreamEvent(MediaStream stream);
|
|
|
|
|
2017-06-30 03:14:06 +03:00
|
|
|
/* Packet dump callback */
|
|
|
|
void onPacket(unsigned long level, mozPacketDumpType type, boolean sending,
|
|
|
|
ArrayBuffer packet);
|
2017-08-23 23:47:54 +03:00
|
|
|
|
|
|
|
/* Transceiver sync */
|
|
|
|
void syncTransceivers();
|
2013-10-14 20:53:56 +04:00
|
|
|
};
|