W3cubDocs

/Haxe JavaScript

PeerConnection

package js.html.rtc

extends EventTarget

@:native("RTCPeerConnection") Available on js

The RTCPeerConnection interface represents 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.

Documentation RTCPeerConnection by Mozilla Contributors, licensed under CC-BY-SA 2.5.

See:

Constructor

new (?configuration:Configuration, ?constraints:Dynamic)

Throws:

null DOMError

Variables

read only canTrickleIceCandidates:Bool

read only iceConnectionState:IceConnectionState

read only iceGatheringState:IceGatheringState

read only idpLoginUrl:String

read only localDescription:SessionDescription

onaddstream:Function

onaddtrack:Function

ondatachannel:Function

onicecandidate:Function

oniceconnectionstatechange:Function

onnegotiationneeded:Function

onremovestream:Function

onsignalingstatechange:Function

ontrack:Function

read only peerIdentity:Promise<IdentityAssertion>

read only remoteDescription:SessionDescription

read only signalingState:SignalingState

Methods

addIceCandidate (candidate:IceCandidate, successCallback:Void ‑> Void, failureCallback:DOMError ‑> Void):Promise<Void>

addIceCandidate (candidate:IceCandidate):Promise<Void>

addStream (stream:MediaStream):Void

addTrack (track:MediaStreamTrack, stream:MediaStream, moreStreams:Rest<MediaStream>):RtpSender

close ():Void

createAnswer (successCallback:SessionDescription ‑> Void, failureCallback:DOMError ‑> Void):Promise<Void>

createAnswer (?options:AnswerOptions):Promise<SessionDescription>

createDataChannel (label:String, ?dataChannelDict:DataChannelInit):Dynamic

createOffer (successCallback:SessionDescription ‑> Void, failureCallback:DOMError ‑> Void, ?options:OfferOptions):Promise<Void>

createOffer (?options:OfferOptions):Promise<SessionDescription>

getConfiguration ():Configuration

getIdentityAssertion ():Promise<String>

getLocalStreams ():Array<MediaStream>

getReceivers ():Array<RtpReceiver>

getRemoteStreams ():Array<MediaStream>

getSenders ():Array<RtpSender>

getStats (selector:MediaStreamTrack, successCallback:StatsReport ‑> Void, failureCallback:DOMError ‑> Void):Promise<Void>

getStats (?selector:MediaStreamTrack):Promise<StatsReport>

getStreamById (streamId:String):MediaStream

removeStream (stream:MediaStream):Void

removeTrack (sender:RtpSender):Void

setIdentityProvider (provider:String, ?protocol:String, ?username:String):Void

setLocalDescription (description:SessionDescription, successCallback:Void ‑> Void, failureCallback:DOMError ‑> Void):Promise<Void>

setLocalDescription (description:SessionDescription):Promise<Void>

setRemoteDescription (description:SessionDescription, successCallback:Void ‑> Void, failureCallback:DOMError ‑> Void):Promise<Void>

setRemoteDescription (description:SessionDescription):Promise<Void>

Static methods

static generateCertificate (keygenAlgorithm:EitherType<Dynamic, String>):Promise<Certificate>

Throws:

null DOMError

© 2005–2018 Haxe Foundation
Licensed under a MIT license.
https://api.haxe.org/js/html/rtc/PeerConnection.html