Skip to main content
Module

x/evt/lib/types/index.ts>dom.RTCPeerConnection

💧EventEmitter's typesafe replacement
Go to Latest
interface dom.RTCPeerConnection
implements EventTarget
import { type dom } from "https://deno.land/x/evt@v2.4.13/lib/types/index.ts";
const { RTCPeerConnection } = dom;

A WebRTC connection between the local computer and a remote peer. It provides methods to connect to a remote peer, maintain and monitor the connection, and close the connection once it's no longer needed.

Properties

readonly
canTrickleIceCandidates: boolean | null
readonly
connectionState: RTCPeerConnectionState
readonly
currentLocalDescription: RTCSessionDescription | null
readonly
currentRemoteDescription: RTCSessionDescription | null
readonly
iceConnectionState: RTCIceConnectionState
readonly
iceGatheringState: RTCIceGatheringState
readonly
idpErrorInfo: string | null
readonly
idpLoginUrl: string | null
readonly
localDescription: RTCSessionDescription | null
onconnectionstatechange: ((this: RTCPeerConnection, ev: Event) => any) | null
ondatachannel: ((this: RTCPeerConnection, ev: RTCDataChannelEvent) => any) | null
onicecandidate: ((this: RTCPeerConnection, ev: RTCPeerConnectionIceEvent) => any) | null
onicecandidateerror: ((this: RTCPeerConnection, ev: RTCPeerConnectionIceErrorEvent) => any) | null
oniceconnectionstatechange: ((this: RTCPeerConnection, ev: Event) => any) | null
onicegatheringstatechange: ((this: RTCPeerConnection, ev: Event) => any) | null
onnegotiationneeded: ((this: RTCPeerConnection, ev: Event) => any) | null
onsignalingstatechange: ((this: RTCPeerConnection, ev: Event) => any) | null
onstatsended: ((this: RTCPeerConnection, ev: RTCStatsEvent) => any) | null
ontrack: ((this: RTCPeerConnection, ev: RTCTrackEvent) => any) | null
readonly
peerIdentity: Promise<RTCIdentityAssertion>
readonly
pendingLocalDescription: RTCSessionDescription | null
readonly
pendingRemoteDescription: RTCSessionDescription | null
readonly
remoteDescription: RTCSessionDescription | null
readonly
sctp: RTCSctpTransport | null
readonly
signalingState: RTCSignalingState

Methods

addIceCandidate(candidate: RTCIceCandidateInit | RTCIceCandidate): Promise<void>
addTrack(track: MediaStreamTrack, ...streams: MediaStream[]): RTCRtpSender
addTransceiver(trackOrKind: MediaStreamTrack | string, init?: RTCRtpTransceiverInit): RTCRtpTransceiver
close(): void
createAnswer(options?: RTCOfferOptions): Promise<RTCSessionDescriptionInit>
createDataChannel(label: string, dataChannelDict?: RTCDataChannelInit): RTCDataChannel
createOffer(options?: RTCOfferOptions): Promise<RTCSessionDescriptionInit>
getConfiguration(): RTCConfiguration
getIdentityAssertion(): Promise<string>
getReceivers(): RTCRtpReceiver[]
getSenders(): RTCRtpSender[]
getStats(selector?: MediaStreamTrack | null): Promise<RTCStatsReport>
getTransceivers(): RTCRtpTransceiver[]
removeTrack(sender: RTCRtpSender): void
setConfiguration(configuration: RTCConfiguration): void
setIdentityProvider(provider: string, options?: RTCIdentityProviderOptions): void
setLocalDescription(description: RTCSessionDescriptionInit): Promise<void>
setRemoteDescription(description: RTCSessionDescriptionInit): Promise<void>
addEventListener<K extends keyof RTCPeerConnectionEventMap>(
type: K,
listener: (this: RTCPeerConnection, ev: RTCPeerConnectionEventMap[K]) => any,
options?: boolean | AddEventListenerOptions,
): void
addEventListener(
type: string,
options?: boolean | AddEventListenerOptions,
): void
removeEventListener<K extends keyof RTCPeerConnectionEventMap>(
type: K,
listener: (this: RTCPeerConnection, ev: RTCPeerConnectionEventMap[K]) => any,
options?: boolean | EventListenerOptions,
): void
removeEventListener(
type: string,
options?: boolean | EventListenerOptions,
): void