createTransport(config)
This module only exports this function.
Argument config
is a RTCConfiguration
object.
But bundlePolicy
and rtcpMuxPolicy
will be ignored.
This function returns Transport
instance.
extends EventEmitter
.
This represents the WebRTC transport holds the peer connection and data channel instance for internal signaling.
closed
- transport closed or not
connectionState
- current connection state
- "new" | "connecting" | "connected" | "disconnected" | "failed" | "closed"
dataHandler
DataHandler
instance
mediaHandler
MediaHandler
instance
- async
startNegotiation()
- starts negotiation and emits
negotiation
event
- starts negotiation and emits
- async
handleNegotiation(payload)
- handle negotiation payloads emitted by
startNegotiation()
from remote peer
- handle negotiation payloads emitted by
- async
restartIce()
- restart ICE connection
- async
getStats()
- get transport stats report
updateIceServers(iceServers)
- update ICE servers
close()
- close transport
negotiation
- emits with negotiation payloads
open
- emits after transport connected
connectionStateChange
- emits with each connection state changes
close
- emits when transport closed
error
- emits when error thrown
extends EventEmitter
.
This class manages RTCDataChannel
on base Transport
.
closed
- transport closed or not
- async
createChannel(label, dcInit)
- returns another
RTCDataChannel
instance - same arguments for
RTCPeerConnection#createDataChannel()
- returns another
channel
- emits
RTCDataChannel
instance which remote peer created
- emits
extends EventEmitter
.
This class manages RTCRtpTransceiver
on base Transport
.
closed
- transport closed or not
- async
sendTrack(track)
- returns
MediaSender
instance track
isMediaStreamTrack
instance- it also creates
MediaReceiver
on remoteMediaHandler
- returns
receiver
- emits
MediaReceiver
instance which paired with remoteMediaSender
- emits
extends EventEmitter
.
Manages MediaStreamTrack
to send.
ended
- sending ended or not
track
- sending
MediaStreamTrack
- sending
kind
- kind of track,
video
oraudio
- kind of track,
- async
replace(newTrack)
- replace current track with new one
- emits
replace
event on remoteMediaReceiver
- async
end()
- end current track sending
- emits
ended
event on remoteMediaReceiver
- async
getStats()
- get sender stats report
- async
getParameters()
- get sender
RTCRtpSendParameters
- get sender
- async
updateParameters(updater)
- update(get+set) sender
RTCRtpSendParameters
- update(get+set) sender
- emits nothing
extends EventEmitter
.
Manage MediaStreamTrack
to receive.
ended
- sending ended or not on remote peer
track
- receiving
MediaStreamTrack
- receiving
kind
- kind of track,
video
oraudio
- kind of track,
- async
getStats()
- get receiver stats report
replace
- emits when remote
MediaSender
replaces track
- emits when remote
ended
- emits when remote
MediaSender
ends
- emits when remote