RTCPeerConnection.idl [plain text]
dictionary RTCOfferAnswerOptions {
boolean voiceActivityDetection = true;
};
dictionary RTCOfferOptions : RTCOfferAnswerOptions {
boolean iceRestart = false;
};
dictionary RTCAnswerOptions : RTCOfferAnswerOptions {
};
dictionary RTCDataChannelInit {
boolean ordered = true;
unsigned short maxRetransmitTime;
unsigned short maxRetransmits;
USVString protocol = "";
boolean negotiated = false;
unsigned short id;
};
[
ActiveDOMObject,
Conditional=WEB_RTC,
ConstructorCallWith=ScriptExecutionContext,
EnabledAtRuntime=peerConnection,
ExportMacro=WEBCORE_EXPORT,
JSBuiltinConstructor,
] interface RTCPeerConnection : EventTarget {
[PrivateIdentifier, CallWith=Document, MayThrowException] void initializeWith(RTCConfiguration configuration);
[PrivateIdentifier, PublicIdentifier] sequence<RTCRtpSender> getSenders();
sequence<RTCRtpReceiver> getReceivers();
sequence<RTCRtpTransceiver> getTransceivers();
[PrivateIdentifier, PublicIdentifier, MayThrowException] RTCRtpSender addTrack(MediaStreamTrack track, MediaStream... streams);
[PrivateIdentifier, PublicIdentifier, MayThrowException] void removeTrack(RTCRtpSender sender);
[MayThrowException] RTCRtpTransceiver addTransceiver(MediaStreamTrack track, optional RTCRtpTransceiverInit init);
[MayThrowException] RTCRtpTransceiver addTransceiver(DOMString kind, optional RTCRtpTransceiverInit init);
[JSBuiltin] sequence<MediaStream> getLocalStreams();
[PrivateIdentifier, PublicIdentifier] sequence<MediaStream> getRemoteStreams();
[JSBuiltin] MediaStream getStreamById(DOMString streamId);
[JSBuiltin] void addStream(MediaStream stream);
[JSBuiltin] void removeStream(MediaStream stream);
[JSBuiltin] Promise<RTCSessionDescriptionInit> createOffer(optional RTCOfferOptions offerOptions);
[JSBuiltin] Promise<RTCSessionDescriptionInit> createAnswer(optional RTCAnswerOptions answerOptions);
[JSBuiltin] Promise<void> setLocalDescription(RTCSessionDescription description);
readonly attribute RTCSessionDescription localDescription;
readonly attribute RTCSessionDescription currentLocalDescription;
readonly attribute RTCSessionDescription pendingLocalDescription;
[JSBuiltin] Promise<void> setRemoteDescription(RTCSessionDescription description);
readonly attribute RTCSessionDescription remoteDescription;
readonly attribute RTCSessionDescription currentRemoteDescription;
readonly attribute RTCSessionDescription pendingRemoteDescription;
readonly attribute DOMString signalingState;
[JSBuiltin] Promise<void> addIceCandidate(RTCIceCandidate candidate);
readonly attribute DOMString iceGatheringState;
readonly attribute DOMString iceConnectionState;
RTCConfiguration getConfiguration();
[MayThrowException] void setConfiguration(RTCConfiguration configuration);
[JSBuiltin] Promise<RTCStatsReport> getStats(optional MediaStreamTrack? selector = null);
[PrivateIdentifier] Promise<RTCSessionDescriptionInit> queuedCreateOffer(optional RTCOfferOptions offerOptions);
[PrivateIdentifier] Promise<RTCSessionDescriptionInit> queuedCreateAnswer(optional RTCAnswerOptions answerOptions);
[PrivateIdentifier] Promise<void> queuedSetLocalDescription(RTCSessionDescription description);
[PrivateIdentifier] Promise<void> queuedSetRemoteDescription(RTCSessionDescription description);
[PrivateIdentifier] Promise<void> queuedAddIceCandidate(RTCIceCandidate candidate);
[PrivateIdentifier] Promise<RTCStatsReport> privateGetStats(MediaStreamTrack? selector);
[CallWith=ScriptExecutionContext, MayThrowException] RTCDataChannel createDataChannel([TreatNullAs=EmptyString] DOMString label, optional RTCDataChannelInit options);
void close();
attribute EventHandler onnegotiationneeded;
attribute EventHandler onicecandidate;
attribute EventHandler onsignalingstatechange;
attribute EventHandler ontrack;
attribute EventHandler oniceconnectionstatechange;
attribute EventHandler onicegatheringstatechange;
attribute EventHandler ondatachannel;
attribute EventHandler onaddstream;
};
enum RTCRtpTransceiverDirection { "sendrecv", "sendonly", "recvonly", "inactive" };
dictionary RTCRtpTransceiverInit {
RTCRtpTransceiverDirection direction = "sendrecv";
};