main.webrtc.RTCPeerConnection.kt Maven / Gradle / Ivy
// Automatically generated - do not modify!
package webrtc
import kotlinx.js.ReadonlyArray
external class RTCPeerConnection(
configuration: RTCConfiguration = definedExternally,
options: Any = definedExternally,
) : org.w3c.dom.events.EventTarget {
fun createOffer(options: RTCOfferOptions = definedExternally): kotlin.js.Promise
fun createAnswer(options: RTCAnswerOptions = definedExternally): kotlin.js.Promise
fun setLocalDescription(description: RTCSessionDescriptionInit): kotlin.js.Promise
val localDescription: RTCSessionDescription?
val currentLocalDescription: RTCSessionDescription?
val pendingLocalDescription: RTCSessionDescription?
fun setRemoteDescription(description: RTCSessionDescriptionInit): kotlin.js.Promise
val remoteDescription: RTCSessionDescription?
val currentRemoteDescription: RTCSessionDescription?
val pendingRemoteDescription: RTCSessionDescription?
fun addIceCandidate(candidate: RTCIceCandidateInit = definedExternally): kotlin.js.Promise
fun addIceCandidate(candidate: RTCIceCandidate = definedExternally): kotlin.js.Promise
val signalingState: RTCSignalingState
val connectionState: RTCPeerConnectionState
fun getConfiguration(): RTCConfiguration
fun setConfiguration(configuration: RTCConfiguration)
fun close()
var onicecandidateerror: PeerConnectionEventHandler
var onconnectionstatechange: PeerConnectionEventHandler
// Extension: https://www.w3.org/TR/webrtc/#h-rtcpeerconnection-interface-extensions
fun getSenders(): ReadonlyArray
fun getReceivers(): ReadonlyArray
fun getTransceivers(): ReadonlyArray
fun addTrack(
track: org.w3c.dom.mediacapture.MediaStreamTrack,
vararg streams: ReadonlyArray,
): RTCRtpSender
fun removeTrack(sender: RTCRtpSender)
fun addTransceiver(
trackOrKind: org.w3c.dom.mediacapture.MediaStreamTrack,
init: RTCRtpTransceiverInit = definedExternally,
): RTCRtpTransceiver
fun addTransceiver(
trackOrKind: String,
init: RTCRtpTransceiverInit = definedExternally,
): RTCRtpTransceiver
var ontrack: PeerConnectionEventHandler
// Extension: https://www.w3.org/TR/webrtc/#h-rtcpeerconnection-interface-extensions-1
val sctp: RTCSctpTransport?
fun createDataChannel(
label: String?,
dataChannelDict: RTCDataChannelInit = definedExternally,
): RTCDataChannel
var ondatachannel: PeerConnectionEventHandler
// Extension: https://www.w3.org/TR/webrtc/#h-rtcpeerconnection-interface-extensions-2
fun getStats(selector: org.w3c.dom.mediacapture.MediaStreamTrack? = definedExternally): kotlin.js.Promise
// Extension: https://www.w3.org/TR/webrtc/#legacy-interface-extensions
// Deprecated!
fun createOffer(
successCallback: RTCSessionDescriptionCallback,
failureCallback: RTCPeerConnectionErrorCallback,
options: RTCOfferOptions = definedExternally,
): kotlin.js.Promise
fun setLocalDescription(
description: RTCSessionDescriptionInit,
successCallback: () -> Unit,
failureCallback: RTCPeerConnectionErrorCallback,
): kotlin.js.Promise
fun createAnswer(
successCallback: RTCSessionDescriptionCallback,
failureCallback: RTCPeerConnectionErrorCallback,
): kotlin.js.Promise
fun setRemoteDescription(
description: RTCSessionDescriptionInit,
successCallback: () -> Unit,
failureCallback: RTCPeerConnectionErrorCallback,
): kotlin.js.Promise
fun addIceCandidate(
candidate: RTCIceCandidateInit,
successCallback: () -> Unit,
failureCallback: RTCPeerConnectionErrorCallback,
): kotlin.js.Promise
fun addIceCandidate(
candidate: RTCIceCandidate,
successCallback: () -> Unit,
failureCallback: RTCPeerConnectionErrorCallback,
): kotlin.js.Promise
fun getStats(
selector: org.w3c.dom.mediacapture.MediaStreamTrack?,
successCallback: (report: RTCStatsReport) -> Unit,
failureCallback: RTCPeerConnectionErrorCallback,
): kotlin.js.Promise
companion object {
val defaultIceServers: ReadonlyArray
// Extension: https://www.w3.org/TR/webrtc/#sec.cert-mgmt
fun generateCertificate(keygenAlgorithm: String): kotlin.js.Promise
}
}