node-webrtc is a Node.js Native Addon that provides bindings to WebRTC M87
This release adds support for MediaStream. Most MediaStream APIs are supported, excluding the "addtrack" and "removetrack" events. You can construct MediaStreams as follows:
const { MediaStream } = require('wrtc');
const stream1 = new MediaStream();
const stream2 = new MediaStream(stream1);
Assuming you already have some Array of MediaStreamTracks, tracks
, you can also construct a MediaStream with
const stream3 = new MediaStream(tracks);
Or, if you have an existing MediaStream, you can clone
it.
const stream4 = stream3.clone();
This release also adds support for the following methods
getTracks
getAudioTracks
getVideoTracks
getTrackById
addTrack
removeTrack
and the following attributes
id
active
This release adds support for the streams
property.
This release adds support for addTrack
, removeTrack
, and getSenders
. Although we don't yet provide a way to construct local MediaStreamTracks, you can relay remote MediaStreamTracks as follows:
pc.ontrack = ({ track, streams }) => {
pc.addTrack(track, ...streams);
};
This release adds support for the following methods
getCapabilities
(always throws for now)getParameters
setParameters
(always returns a rejected Promise for now)getStats
(always returns a rejected Promise for now)replaceTrack
and the following attributes
track
transport
(always returns null
for now)rtcpTransport
(always returns null
for now)getReceivers
.track
and receiver
. In the future, we will add support for the streams
and transceiver
attributes.This release adds partial support for RTCRtpReceiver, including methods
getParameters
getContributingSources
(always returns an empty array for now)getSynchronizationSources
(always returns an empty array for now)getStats
(always returns a rejected Promise for now)and attributes
track
transport
(always returns null
for now)rtcpTransport
(always returns null
for now)RTCRtpReceiver also includes partial support for the static method getCapabilities
; however, it always returns a rejected Promise.
This release adds partial support for remote MediaStreamTracks, including attributes
enabled
(read-only for now)id
kind
readyState
createDataChannel
on a closed RTCPeerConnection no longer returns undefined
; instead, it raises an InvalidStateError (#314, #382).epoll
-based PhysicalSocketServer from WebRTC M61 into node-webrtc. This allows many more concurrent RTCPeerConnections on Linux (for example, up to 3000 in my tests, not exceeding thread limits). (#362)This project will begin to follow SemVer in preparation for a 1.0.0 release.
Besides updating to WebRTC M60 (using mayeut/libwebrtc), this release adds a number of features that bring node-webrtc closer to standards-compliance. We still have a ways to go, but we're now testing against w3c/web-platform-tests.
RTCPeerConnection's constructor now accepts the following standard properties:
bundlePolicy
iceCandidatePoolSize
iceServers
(no support for OAuth yet)iceTransportPolicy
rtcpMuxPolicy
RTCConfiguration also accepts a non-standard property, portRange
. This property constrains the port range used by the RTCPeerConnection's ICE transports. For example,
const { RTCPeerConnection } = require('wrtc');
const pc = new RTCPeerConnection({
portRange: {
min: 10000, // defaults to 0
max: 20000 // defaults to 65535
}
});
RTCPeerConnection now supports two new methods:
getConfiguration
setConfiguration
RTCPeerConnection now supports the following properties:
canTrickleIceCandidates
(always returns null
for now)connectionState
(derived from iceConnectionState
)currentLocalDescription
currentRemoteDescription
pendingLocalDescription
pendingRemoteDescription
RTCPeerConnection now supports the following events:
RTCPeerConnection's createOffer
method now accepts RTCOfferOptions, and RTCPeerConnection's createAnswer
method now accepts RTCAnswerOptions. RTCOfferOptions supports
iceRestart
offerToReceiveAudio
offerToReceiveVideo
Both RTCOfferOptions and RTCAnswerOptions support voiceActivityDetection
.
RTCPeerConnection's createDataChannel
method now accepts
id
maxPacketLifeTime
maxRetransmits
negotiated
ordered
protocol
RTCDataChannel supports the following properties:
id
maxRetransmits
ordered
priority
(always returns "high")protocol
RTCDataChannel's send
method now supports sending Blobs provided by jsdom; however, there is no support for receiving Blobs.
Added top-level exports for
lib/browser.js
. This means that, when bundling JavaScript that depends on node-webrtc for the browser, the resulting bundle will no longer depend on these APIs (#369).url
attribute in RTCIceServer.RTCIceConnectionStates
, RTCIceGatheringStates
, and RTCSignalingStates
properties on the RTCPeerConnection prototype. These were an implementation detail that some libraries used for detecting node-webrtc.RTCDataStates
and BinaryTypes
properties on the RTCDataChannel prototype. This, too, was an implementation detail.Ref
in the ObjectWrap instances' constructors and Unref
in their event loops.offset
or length
properties. This resulted in sending the entire backing ArrayBuffer instead of just the data in the ArrayBufferView.