Le SELECT du choix de rôle devient un radio
This commit is contained in:
30
node_modules/wrtc/LICENSE.md
generated
vendored
Normal file
30
node_modules/wrtc/LICENSE.md
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
The following license applies to all parts of this software except as documented
|
||||
below.
|
||||
|
||||
```
|
||||
Copyright (c) 2019 The node-webrtc project authors. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
```
|
||||
|
||||
Binary distributions of this software include WebRTC and other third-party
|
||||
libraries. These libraries and licenses are documented in
|
||||
THIRD_PARTY_LICENSES.md.
|
||||
120
node_modules/wrtc/README.md
generated
vendored
Normal file
120
node_modules/wrtc/README.md
generated
vendored
Normal file
@@ -0,0 +1,120 @@
|
||||
<h1 align="center">
|
||||
<img height="120px" src="https://upload.wikimedia.org/wikipedia/commons/d/d9/Node.js_logo.svg" />
|
||||
<img height="120px" src="https://webrtc.github.io/webrtc-org/assets/images/webrtc-logo-vert-retro-dist.svg" />
|
||||
</h1>
|
||||
|
||||
[](https://www.npmjs.com/package/wrtc) [](https://circleci.com/gh/node-webrtc/node-webrtc) [](https://ci.appveyor.com/project/markandrus/node-webrtc-7bnua)
|
||||
|
||||
node-webrtc is a Node.js Native Addon that provides bindings to [WebRTC M81](https://chromium.googlesource.com/external/webrtc/+/branch-heads/4044). This project aims for spec-compliance and is tested using the W3C's [web-platform-tests](https://github.com/web-platform-tests/wpt) project. A number of [nonstandard APIs](https://github.com/node-webrtc/node-webrtc/blob/v0.4.7/docs/nonstandard-apis.md) for testing are also included.
|
||||
|
||||
Install
|
||||
-------
|
||||
|
||||
```
|
||||
npm install wrtc
|
||||
```
|
||||
|
||||
Installing from NPM downloads a prebuilt binary for your operating system × architecture. Set the `TARGET_ARCH` environment variable to "arm" or "arm64" to download for armv7l or arm64, respectively. Linux and macOS users can also set the `DEBUG` environment variable to download debug builds.
|
||||
|
||||
You can also [build from source](https://github.com/node-webrtc/node-webrtc/blob/v0.4.7/docs/build-from-source.md).
|
||||
|
||||
Supported Platforms
|
||||
-------------------
|
||||
|
||||
The following platforms are confirmed to work with node-webrtc and have prebuilt binaries available. Since node-webrtc targets [N-API version 3](https://nodejs.org/api/n-api.html), there may be additional platforms supported that are not listed here. If your platform is not supported, you may still be able to [build from source](https://github.com/node-webrtc/node-webrtc/blob/v0.4.7/docs/build-from-source.md).
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<td colspan="2" rowspan="2"></td>
|
||||
<th colspan="3">Linux</th>
|
||||
<th>macOS</th>
|
||||
<th>Windows</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>armv7l</th>
|
||||
<th>arm64</th>
|
||||
<th>x64</th>
|
||||
<th>x64</th>
|
||||
<th>x64</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th rowspan="6">Node</th>
|
||||
<th>8</th>
|
||||
<td align="center">✓</td>
|
||||
<td align="center">✓</td>
|
||||
<td align="center">✓</td>
|
||||
<td align="center">✓</td>
|
||||
<td align="center">✓</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>10</th>
|
||||
<td align="center">✓</td>
|
||||
<td align="center">✓</td>
|
||||
<td align="center">✓</td>
|
||||
<td align="center">✓</td>
|
||||
<td align="center">✓</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>11</th>
|
||||
<td align="center">✓</td>
|
||||
<td align="center">✓</td>
|
||||
<td align="center">✓</td>
|
||||
<td align="center">✓</td>
|
||||
<td align="center">✓</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>12</th>
|
||||
<td align="center">✓</td>
|
||||
<td align="center">✓</td>
|
||||
<td align="center">✓</td>
|
||||
<td align="center">✓</td>
|
||||
<td align="center">✓</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>13</th>
|
||||
<td align="center">✓</td>
|
||||
<td align="center">✓</td>
|
||||
<td align="center">✓</td>
|
||||
<td align="center">✓</td>
|
||||
<td align="center">✓</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>14</th>
|
||||
<td align="center">✓</td>
|
||||
<td align="center">✓</td>
|
||||
<td align="center">✓</td>
|
||||
<td align="center">✓</td>
|
||||
<td align="center">✓</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th rowspan="2">Electron</th>
|
||||
<th>4</th>
|
||||
<td align="center"></td>
|
||||
<td align="center"></td>
|
||||
<td align="center">✓</td>
|
||||
<td align="center">✓</td>
|
||||
<td align="center">✓</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>5</th>
|
||||
<td align="center"></td>
|
||||
<td align="center"></td>
|
||||
<td align="center">✓</td>
|
||||
<td align="center">✓</td>
|
||||
<td align="center">✓</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
Examples
|
||||
--------
|
||||
|
||||
See [node-webrtc/node-webrtc-examples](https://github.com/node-webrtc/node-webrtc-examples).
|
||||
|
||||
Contributing
|
||||
------------
|
||||
|
||||
Contributions welcome! Please refer to the [wiki](https://github.com/node-webrtc/node-webrtc/wiki/Contributing).
|
||||
1314
node_modules/wrtc/THIRD_PARTY_LICENSES.md
generated
vendored
Normal file
1314
node_modules/wrtc/THIRD_PARTY_LICENSES.md
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
BIN
node_modules/wrtc/build/Release/wrtc.node
generated
vendored
Executable file
BIN
node_modules/wrtc/build/Release/wrtc.node
generated
vendored
Executable file
Binary file not shown.
7
node_modules/wrtc/lib/binding.js
generated
vendored
Normal file
7
node_modules/wrtc/lib/binding.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
try {
|
||||
module.exports = require('../build/Debug/wrtc.node');
|
||||
} catch (error) {
|
||||
module.exports = require('../build/Release/wrtc.node');
|
||||
}
|
||||
18
node_modules/wrtc/lib/browser.js
generated
vendored
Normal file
18
node_modules/wrtc/lib/browser.js
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
'use strict';
|
||||
|
||||
exports.MediaStream = window.MediaStream;
|
||||
exports.MediaStreamTrack = window.MediaStreamTrack;
|
||||
exports.RTCDataChannel = window.RTCDataChannel;
|
||||
exports.RTCDataChannelEvent = window.RTCDataChannelEvent;
|
||||
exports.RTCDtlsTransport = window.RTCDtlsTransport;
|
||||
exports.RTCIceCandidate = window.RTCIceCandidate;
|
||||
exports.RTCIceTransport = window.RTCIceTransport;
|
||||
exports.RTCPeerConnection = window.RTCPeerConnection;
|
||||
exports.RTCPeerConnectionIceEvent = window.RTCPeerConnectionIceEvent;
|
||||
exports.RTCRtpReceiver = window.RTCRtpReceiver;
|
||||
exports.RTCRtpSender = window.RTCRtpSender;
|
||||
exports.RTCRtpTransceiver = window.RTCRtpTransceiver;
|
||||
exports.RTCSctpTransport = window.RTCSctpTransport;
|
||||
exports.RTCSessionDescription = window.RTCSessionDescription;
|
||||
exports.getUserMedia = window.getUserMedia;
|
||||
exports.mediaDevices = navigator.mediaDevices;
|
||||
22
node_modules/wrtc/lib/datachannelevent.js
generated
vendored
Normal file
22
node_modules/wrtc/lib/datachannelevent.js
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
'use strict';
|
||||
|
||||
function RTCDataChannelEvent(type, eventInitDict) {
|
||||
Object.defineProperties(this, {
|
||||
bubbles: {
|
||||
value: false
|
||||
},
|
||||
cancelable: {
|
||||
value: false
|
||||
},
|
||||
type: {
|
||||
value: type,
|
||||
enumerable: true
|
||||
},
|
||||
channel: {
|
||||
value: eventInitDict.channel,
|
||||
enumerable: true
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = RTCDataChannelEvent;
|
||||
9
node_modules/wrtc/lib/datachannelmessageevent.js
generated
vendored
Normal file
9
node_modules/wrtc/lib/datachannelmessageevent.js
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
'use strict';
|
||||
|
||||
function RTCDataChannelMessageEvent(message) {
|
||||
this.data = message;
|
||||
}
|
||||
|
||||
RTCDataChannelMessageEvent.prototype.type = 'message';
|
||||
|
||||
module.exports = RTCDataChannelMessageEvent;
|
||||
20
node_modules/wrtc/lib/error.js
generated
vendored
Normal file
20
node_modules/wrtc/lib/error.js
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
'use strict';
|
||||
|
||||
function RTCError(code, message) {
|
||||
this.name = this.reasonName[Math.min(code, this.reasonName.length - 1)];
|
||||
this.message = typeof message === 'string' ? message : this.name;
|
||||
}
|
||||
|
||||
RTCError.prototype.reasonName = [
|
||||
// These strings must match those defined in the WebRTC spec.
|
||||
'NO_ERROR', // Should never happen -- only used for testing
|
||||
'INVALID_CONSTRAINTS_TYPE',
|
||||
'INVALID_CANDIDATE_TYPE',
|
||||
'INVALID_STATE',
|
||||
'INVALID_SESSION_DESCRIPTION',
|
||||
'INCOMPATIBLE_SESSION_DESCRIPTION',
|
||||
'INCOMPATIBLE_CONSTRAINTS',
|
||||
'INTERNAL_ERROR'
|
||||
];
|
||||
|
||||
module.exports = RTCError;
|
||||
50
node_modules/wrtc/lib/eventtarget.js
generated
vendored
Normal file
50
node_modules/wrtc/lib/eventtarget.js
generated
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* @author mrdoob / http://mrdoob.com/
|
||||
* @author Jesús Leganés Combarro "Piranna" <piranna@gmail.com>
|
||||
*/
|
||||
|
||||
function EventTarget() {
|
||||
this._listeners = {};
|
||||
}
|
||||
|
||||
EventTarget.prototype.addEventListener = function addEventListener(type, listener) {
|
||||
const listeners = this._listeners = this._listeners || {};
|
||||
|
||||
if (!listeners[type]) {
|
||||
listeners[type] = new Set();
|
||||
}
|
||||
|
||||
listeners[type].add(listener);
|
||||
};
|
||||
|
||||
EventTarget.prototype.dispatchEvent = function dispatchEvent(event) {
|
||||
let listeners = this._listeners = this._listeners || {};
|
||||
|
||||
process.nextTick(() => {
|
||||
listeners = new Set(listeners[event.type] || []);
|
||||
|
||||
const dummyListener = this['on' + event.type];
|
||||
if (typeof dummyListener === 'function') {
|
||||
listeners.add(dummyListener);
|
||||
}
|
||||
|
||||
listeners.forEach(listener => {
|
||||
if (typeof listener === 'object' && typeof listener.handleEvent === 'function') {
|
||||
listener.handleEvent(event);
|
||||
} else {
|
||||
listener.call(this, event);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
EventTarget.prototype.removeEventListener = function removeEventListener(type, listener) {
|
||||
const listeners = this._listeners = this._listeners || {};
|
||||
if (listeners[type]) {
|
||||
listeners[type].delete(listener);
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = EventTarget;
|
||||
28
node_modules/wrtc/lib/icecandidate.js
generated
vendored
Normal file
28
node_modules/wrtc/lib/icecandidate.js
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
'use strict';
|
||||
|
||||
function RTCIceCandidate(candidateInitDict) {
|
||||
[
|
||||
'candidate',
|
||||
'sdpMid',
|
||||
'sdpMLineIndex',
|
||||
'foundation',
|
||||
'component',
|
||||
'priority',
|
||||
'address',
|
||||
'protocol',
|
||||
'port',
|
||||
'type',
|
||||
'tcpType',
|
||||
'relatedAddress',
|
||||
'relatedPort',
|
||||
'usernameFragment'
|
||||
].forEach(property => {
|
||||
if (candidateInitDict && property in candidateInitDict) {
|
||||
this[property] = candidateInitDict[property];
|
||||
} else {
|
||||
this[property] = null;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = RTCIceCandidate;
|
||||
81
node_modules/wrtc/lib/index.js
generated
vendored
Normal file
81
node_modules/wrtc/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
'use strict';
|
||||
|
||||
const { inherits } = require('util');
|
||||
|
||||
const {
|
||||
MediaStream,
|
||||
MediaStreamTrack,
|
||||
RTCAudioSink,
|
||||
RTCAudioSource,
|
||||
RTCDataChannel,
|
||||
RTCDtlsTransport,
|
||||
RTCIceTransport,
|
||||
RTCRtpReceiver,
|
||||
RTCRtpSender,
|
||||
RTCRtpTransceiver,
|
||||
RTCSctpTransport,
|
||||
RTCVideoSink,
|
||||
RTCVideoSource,
|
||||
getUserMedia,
|
||||
i420ToRgba,
|
||||
rgbaToI420,
|
||||
setDOMException
|
||||
} = require('./binding');
|
||||
|
||||
const EventTarget = require('./eventtarget');
|
||||
const MediaDevices = require('./mediadevices');
|
||||
|
||||
inherits(MediaStream, EventTarget);
|
||||
inherits(MediaStreamTrack, EventTarget);
|
||||
inherits(RTCAudioSink, EventTarget);
|
||||
inherits(RTCDataChannel, EventTarget);
|
||||
inherits(RTCDtlsTransport, EventTarget);
|
||||
inherits(RTCIceTransport, EventTarget);
|
||||
inherits(RTCSctpTransport, EventTarget);
|
||||
inherits(RTCVideoSink, EventTarget);
|
||||
|
||||
try {
|
||||
setDOMException(require('domexception'));
|
||||
} catch (error) {
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
// NOTE(mroberts): Here's a hack to support jsdom's Blob implementation.
|
||||
RTCDataChannel.prototype.send = function send(data) {
|
||||
const implSymbol = Object.getOwnPropertySymbols(data).find(symbol => symbol.toString() === 'Symbol(impl)');
|
||||
if (data[implSymbol] && data[implSymbol]._buffer) {
|
||||
data = data[implSymbol]._buffer;
|
||||
}
|
||||
this._send(data);
|
||||
};
|
||||
|
||||
const mediaDevices = new MediaDevices();
|
||||
|
||||
const nonstandard = {
|
||||
i420ToRgba,
|
||||
RTCAudioSink,
|
||||
RTCAudioSource,
|
||||
RTCVideoSink,
|
||||
RTCVideoSource,
|
||||
rgbaToI420
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
MediaStream,
|
||||
MediaStreamTrack,
|
||||
RTCDataChannel,
|
||||
RTCDataChannelEvent: require('./datachannelevent'),
|
||||
RTCDtlsTransport,
|
||||
RTCIceCandidate: require('./icecandidate'),
|
||||
RTCIceTransport,
|
||||
RTCPeerConnection: require('./peerconnection'),
|
||||
RTCPeerConnectionIceEvent: require('./rtcpeerconnectioniceevent'),
|
||||
RTCRtpReceiver,
|
||||
RTCRtpSender,
|
||||
RTCRtpTransceiver,
|
||||
RTCSctpTransport,
|
||||
RTCSessionDescription: require('./sessiondescription'),
|
||||
getUserMedia,
|
||||
mediaDevices,
|
||||
nonstandard,
|
||||
};
|
||||
24
node_modules/wrtc/lib/mediadevices.js
generated
vendored
Normal file
24
node_modules/wrtc/lib/mediadevices.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
'use strict';
|
||||
|
||||
var inherits = require('util').inherits;
|
||||
|
||||
const { getDisplayMedia, getUserMedia } = require('./binding');
|
||||
|
||||
var EventTarget = require('./eventtarget');
|
||||
|
||||
function MediaDevices() {}
|
||||
|
||||
inherits(MediaDevices, EventTarget);
|
||||
|
||||
MediaDevices.prototype.enumerateDevices = function enumerateDevices() {
|
||||
throw new Error('Not yet implemented; file a feature request against node-webrtc');
|
||||
};
|
||||
|
||||
MediaDevices.prototype.getSupportedConstraints = function getSupportedConstraints() {
|
||||
throw new Error('Not yet implemented; file a feature request against node-webrtc');
|
||||
};
|
||||
|
||||
MediaDevices.prototype.getDisplayMedia = getDisplayMedia;
|
||||
MediaDevices.prototype.getUserMedia = getUserMedia;
|
||||
|
||||
module.exports = MediaDevices;
|
||||
311
node_modules/wrtc/lib/peerconnection.js
generated
vendored
Normal file
311
node_modules/wrtc/lib/peerconnection.js
generated
vendored
Normal file
@@ -0,0 +1,311 @@
|
||||
'use strict';
|
||||
|
||||
var inherits = require('util').inherits;
|
||||
|
||||
var _webrtc = require('./binding');
|
||||
|
||||
var EventTarget = require('./eventtarget');
|
||||
|
||||
var RTCDataChannelEvent = require('./datachannelevent');
|
||||
var RTCIceCandidate = require('./icecandidate');
|
||||
var RTCPeerConnectionIceEvent = require('./rtcpeerconnectioniceevent');
|
||||
var RTCPeerConnectionIceErrorEvent = require('./rtcpeerconnectioniceerrorevent');
|
||||
var RTCSessionDescription = require('./sessiondescription');
|
||||
|
||||
function RTCPeerConnection() {
|
||||
var self = this;
|
||||
var pc = new _webrtc.RTCPeerConnection(arguments[0] || {});
|
||||
|
||||
EventTarget.call(this);
|
||||
|
||||
//
|
||||
// Attach events to the native PeerConnection object
|
||||
//
|
||||
pc.ontrack = function ontrack(receiver, streams, transceiver) {
|
||||
self.dispatchEvent({
|
||||
type: 'track',
|
||||
track: receiver.track,
|
||||
receiver: receiver,
|
||||
streams: streams,
|
||||
transceiver: transceiver
|
||||
});
|
||||
};
|
||||
|
||||
pc.onconnectionstatechange = function onconnectionstatechange() {
|
||||
self.dispatchEvent({ type: 'connectionstatechange' });
|
||||
};
|
||||
|
||||
pc.onicecandidate = function onicecandidate(candidate) {
|
||||
var icecandidate = new RTCIceCandidate(candidate);
|
||||
self.dispatchEvent(new RTCPeerConnectionIceEvent('icecandidate', { candidate: icecandidate, target: self }));
|
||||
};
|
||||
|
||||
pc.onicecandidateerror = function onicecandidateerror(eventInitDict) {
|
||||
var pair = eventInitDict.hostCandidate.split(':');
|
||||
eventInitDict.address = pair[0];
|
||||
eventInitDict.port = pair[1];
|
||||
var icecandidateerror = new RTCPeerConnectionIceErrorEvent('icecandidateerror', eventInitDict);
|
||||
self.dispatchEvent(icecandidateerror);
|
||||
};
|
||||
|
||||
pc.onsignalingstatechange = function onsignalingstatechange() {
|
||||
self.dispatchEvent({ type: 'signalingstatechange', target: self });
|
||||
};
|
||||
|
||||
pc.oniceconnectionstatechange = function oniceconnectionstatechange() {
|
||||
self.dispatchEvent({ type: 'iceconnectionstatechange', target: self });
|
||||
};
|
||||
|
||||
pc.onicegatheringstatechange = function onicegatheringstatechange() {
|
||||
self.dispatchEvent({ type: 'icegatheringstatechange', target: self });
|
||||
|
||||
// if we have completed gathering candidates, trigger a null candidate event
|
||||
if (self.iceGatheringState === 'complete' && self.connectionState !== 'closed') {
|
||||
self.dispatchEvent(new RTCPeerConnectionIceEvent('icecandidate', { candidate: null, target: self }));
|
||||
}
|
||||
};
|
||||
|
||||
pc.onnegotiationneeded = function onnegotiationneeded() {
|
||||
self.dispatchEvent({ type: 'negotiationneeded', target: self });
|
||||
};
|
||||
|
||||
// [ToDo] onnegotiationneeded
|
||||
|
||||
pc.ondatachannel = function ondatachannel(channel) {
|
||||
self.dispatchEvent(new RTCDataChannelEvent('datachannel', { channel }));
|
||||
};
|
||||
|
||||
//
|
||||
// PeerConnection properties & attributes
|
||||
//
|
||||
|
||||
Object.defineProperties(this, {
|
||||
_pc: {
|
||||
value: pc
|
||||
},
|
||||
canTrickleIceCandidates: {
|
||||
get: function getCanTrickleIceCandidates() {
|
||||
return pc.canTrickleIceCandidates;
|
||||
},
|
||||
enumerable: true
|
||||
},
|
||||
connectionState: {
|
||||
get: function getConnectionState() {
|
||||
return pc.connectionState;
|
||||
},
|
||||
enumerable: true
|
||||
},
|
||||
currentLocalDescription: {
|
||||
get: function getCurrentLocalDescription() {
|
||||
return pc.currentLocalDescription
|
||||
? new RTCSessionDescription(pc.currentLocalDescription)
|
||||
: null;
|
||||
},
|
||||
enumerable: true
|
||||
},
|
||||
localDescription: {
|
||||
get: function getLocalDescription() {
|
||||
return pc.localDescription
|
||||
? new RTCSessionDescription(pc.localDescription)
|
||||
: null;
|
||||
},
|
||||
enumerable: true
|
||||
},
|
||||
pendingLocalDescription: {
|
||||
get: function getPendingLocalDescription() {
|
||||
return pc.pendingLocalDescription
|
||||
? new RTCSessionDescription(pc.pendingLocalDescription)
|
||||
: null;
|
||||
},
|
||||
enumerable: true
|
||||
},
|
||||
currentRemoteDescription: {
|
||||
get: function getCurrentRemoteDescription() {
|
||||
return pc.currentRemoteDescription
|
||||
? new RTCSessionDescription(pc.currentRemoteDescription)
|
||||
: null;
|
||||
},
|
||||
enumerable: true
|
||||
},
|
||||
remoteDescription: {
|
||||
get: function getRemoteDescription() {
|
||||
return pc.remoteDescription
|
||||
? new RTCSessionDescription(pc.remoteDescription)
|
||||
: null;
|
||||
},
|
||||
enumerable: true
|
||||
},
|
||||
pendingRemoteDescription: {
|
||||
get: function getPendingRemoteDescription() {
|
||||
return pc.pendingRemoteDescription
|
||||
? new RTCSessionDescription(pc.pendingRemoteDescription)
|
||||
: null;
|
||||
},
|
||||
enumerable: true
|
||||
},
|
||||
signalingState: {
|
||||
get: function getSignalingState() {
|
||||
return pc.signalingState;
|
||||
},
|
||||
enumerable: true
|
||||
},
|
||||
readyState: {
|
||||
get: function getReadyState() {
|
||||
return pc.getReadyState();
|
||||
}
|
||||
},
|
||||
sctp: {
|
||||
get: function() {
|
||||
return pc.sctp;
|
||||
},
|
||||
enumerable: true
|
||||
},
|
||||
iceGatheringState: {
|
||||
get: function getIceGatheringState() {
|
||||
return pc.iceGatheringState;
|
||||
},
|
||||
enumerable: true
|
||||
},
|
||||
iceConnectionState: {
|
||||
get: function getIceConnectionState() {
|
||||
return pc.iceConnectionState;
|
||||
},
|
||||
enumerable: true
|
||||
},
|
||||
onconnectionstatechange: {
|
||||
value: null,
|
||||
writable: true,
|
||||
enumerable: true
|
||||
},
|
||||
ondatachannel: {
|
||||
value: null,
|
||||
writable: true,
|
||||
enumerable: true
|
||||
},
|
||||
oniceconnectionstatechange: {
|
||||
value: null,
|
||||
writable: true,
|
||||
enumerable: true
|
||||
},
|
||||
onicegatheringstatechange: {
|
||||
value: null,
|
||||
writable: true,
|
||||
enumerable: true
|
||||
},
|
||||
onnegotiationneeded: {
|
||||
value: null,
|
||||
writable: true,
|
||||
enumerable: true
|
||||
},
|
||||
onsignalingstatechange: {
|
||||
value: null,
|
||||
writable: true,
|
||||
enumerable: true
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
inherits(RTCPeerConnection, EventTarget);
|
||||
|
||||
// NOTE(mroberts): This is a bit of a hack.
|
||||
RTCPeerConnection.prototype.ontrack = null;
|
||||
|
||||
RTCPeerConnection.prototype.addIceCandidate = function addIceCandidate(candidate) {
|
||||
var promise = this._pc.addIceCandidate(candidate);
|
||||
if (arguments.length === 3) {
|
||||
promise.then(arguments[1], arguments[2]);
|
||||
}
|
||||
return promise;
|
||||
};
|
||||
|
||||
RTCPeerConnection.prototype.addTransceiver = function addTransceiver() {
|
||||
return this._pc.addTransceiver.apply(this._pc, arguments);
|
||||
};
|
||||
|
||||
RTCPeerConnection.prototype.addTrack = function addTrack(track, ...streams) {
|
||||
return this._pc.addTrack(track, streams);
|
||||
};
|
||||
|
||||
RTCPeerConnection.prototype.close = function close() {
|
||||
this._pc.close();
|
||||
};
|
||||
|
||||
RTCPeerConnection.prototype.createDataChannel = function createDataChannel() {
|
||||
return this._pc.createDataChannel.apply(this._pc, arguments);
|
||||
};
|
||||
|
||||
RTCPeerConnection.prototype.createOffer = function createOffer() {
|
||||
var options = arguments.length === 3
|
||||
? arguments[2]
|
||||
: arguments[0];
|
||||
var promise = this._pc.createOffer(options || {});
|
||||
if (arguments.length >= 2) {
|
||||
promise.then(arguments[0], arguments[1]);
|
||||
}
|
||||
return promise;
|
||||
};
|
||||
|
||||
RTCPeerConnection.prototype.createAnswer = function createAnswer() {
|
||||
var options = arguments.length === 3
|
||||
? arguments[2]
|
||||
: arguments[0];
|
||||
var promise = this._pc.createAnswer(options || {});
|
||||
if (arguments.length >= 2) {
|
||||
promise.then(arguments[0], arguments[1]);
|
||||
}
|
||||
return promise;
|
||||
};
|
||||
|
||||
RTCPeerConnection.prototype.getConfiguration = function getConfiguration() {
|
||||
return this._pc.getConfiguration();
|
||||
};
|
||||
|
||||
RTCPeerConnection.prototype.getReceivers = function getReceivers() {
|
||||
return this._pc.getReceivers();
|
||||
};
|
||||
|
||||
RTCPeerConnection.prototype.getSenders = function getSenders() {
|
||||
return this._pc.getSenders();
|
||||
};
|
||||
|
||||
RTCPeerConnection.prototype.getTransceivers = function getTransceivers() {
|
||||
return this._pc.getTransceivers();
|
||||
};
|
||||
|
||||
RTCPeerConnection.prototype.getStats = function getStats() {
|
||||
if (typeof arguments[0] === 'function') {
|
||||
this._pc.legacyGetStats().then(arguments[0], arguments[1]);
|
||||
return;
|
||||
}
|
||||
return this._pc.getStats();
|
||||
};
|
||||
|
||||
RTCPeerConnection.prototype.removeTrack = function removeTrack(sender) {
|
||||
this._pc.removeTrack(sender);
|
||||
};
|
||||
|
||||
RTCPeerConnection.prototype.setConfiguration = function setConfiguration(configuration) {
|
||||
return this._pc.setConfiguration(configuration);
|
||||
};
|
||||
|
||||
RTCPeerConnection.prototype.setLocalDescription = function setLocalDescription(description) {
|
||||
var promise = this._pc.setLocalDescription(description);
|
||||
if (arguments.length === 3) {
|
||||
promise.then(arguments[1], arguments[2]);
|
||||
}
|
||||
return promise;
|
||||
};
|
||||
|
||||
RTCPeerConnection.prototype.setRemoteDescription = function setRemoteDescription(description) {
|
||||
var promise = this._pc.setRemoteDescription(description);
|
||||
if (arguments.length === 3) {
|
||||
promise.then(arguments[1], arguments[2]);
|
||||
}
|
||||
return promise;
|
||||
};
|
||||
|
||||
RTCPeerConnection.prototype.restartIce = function restartIce() {
|
||||
return this._pc.restartIce();
|
||||
};
|
||||
|
||||
module.exports = RTCPeerConnection;
|
||||
32
node_modules/wrtc/lib/rtcpeerconnectioniceerrorevent.js
generated
vendored
Normal file
32
node_modules/wrtc/lib/rtcpeerconnectioniceerrorevent.js
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
'use strict';
|
||||
|
||||
function RTCPeerConnectionIceErrorEvent(type, eventInitDict) {
|
||||
Object.defineProperties(this, {
|
||||
type: {
|
||||
value: type,
|
||||
enumerable: true
|
||||
},
|
||||
address: {
|
||||
value: eventInitDict.address,
|
||||
enumerable: true
|
||||
},
|
||||
port: {
|
||||
value: eventInitDict.port,
|
||||
enumerable: true
|
||||
},
|
||||
url: {
|
||||
value: eventInitDict.url,
|
||||
enumerable: true
|
||||
},
|
||||
errorCode: {
|
||||
value: eventInitDict.errorCode,
|
||||
enumerable: true
|
||||
},
|
||||
errorText: {
|
||||
value: eventInitDict.errorText,
|
||||
enumerable: true
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = RTCPeerConnectionIceErrorEvent;
|
||||
20
node_modules/wrtc/lib/rtcpeerconnectioniceevent.js
generated
vendored
Normal file
20
node_modules/wrtc/lib/rtcpeerconnectioniceevent.js
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
'use strict';
|
||||
|
||||
function RTCPeerConnectionIceEvent(type, eventInitDict) {
|
||||
Object.defineProperties(this, {
|
||||
type: {
|
||||
value: type,
|
||||
enumerable: true
|
||||
},
|
||||
candidate: {
|
||||
value: eventInitDict.candidate,
|
||||
enumerable: true
|
||||
},
|
||||
target: {
|
||||
value: eventInitDict.target,
|
||||
enumerable: true
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = RTCPeerConnectionIceEvent;
|
||||
10
node_modules/wrtc/lib/sessiondescription.js
generated
vendored
Normal file
10
node_modules/wrtc/lib/sessiondescription.js
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
'use strict';
|
||||
|
||||
function RTCSessionDescription(descriptionInitDict) {
|
||||
if (descriptionInitDict) {
|
||||
this.type = descriptionInitDict.type;
|
||||
this.sdp = descriptionInitDict.sdp;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = RTCSessionDescription;
|
||||
42
node_modules/wrtc/package.json
generated
vendored
Normal file
42
node_modules/wrtc/package.json
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"node-pre-gyp": "^0.13.0"
|
||||
},
|
||||
"scripts": {
|
||||
"install": "node scripts/download-prebuilt.js"
|
||||
},
|
||||
"name": "wrtc",
|
||||
"description": "Standards-compliant WebRTC implementation for Node",
|
||||
"keywords": [
|
||||
"webrtc",
|
||||
"p2p",
|
||||
"peer"
|
||||
],
|
||||
"version": "0.4.7",
|
||||
"author": "Alan K <ack@modeswitch.org> (http://blog.modeswitch.org)",
|
||||
"homepage": "https://github.com/node-webrtc/node-webrtc",
|
||||
"bugs": "https://github.com/node-webrtc/node-webrtc/issues",
|
||||
"license": "BSD-2-Clause",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "http://github.com/node-webrtc/node-webrtc.git"
|
||||
},
|
||||
"main": "lib/index.js",
|
||||
"browser": "lib/browser.js",
|
||||
"binary": {
|
||||
"module_name": "wrtc",
|
||||
"module_path": "./build/{configuration}/",
|
||||
"remote_path": "./{module_name}/v{version}/{configuration}/",
|
||||
"package_name": "{platform}-{arch}.tar.gz",
|
||||
"host": "https://node-webrtc.s3.amazonaws.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^8.11.2 || >=10.0.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"domexception": "^1.0.1"
|
||||
},
|
||||
"bundledDependencies": [
|
||||
"node-pre-gyp"
|
||||
]
|
||||
}
|
||||
35
node_modules/wrtc/scripts/download-prebuilt.js
generated
vendored
Executable file
35
node_modules/wrtc/scripts/download-prebuilt.js
generated
vendored
Executable file
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env node
|
||||
/* eslint no-process-env:0, no-process-exit:0 */
|
||||
'use strict';
|
||||
|
||||
const { spawnSync } = require('child_process');
|
||||
|
||||
function main(exit) {
|
||||
const args = ['install'];
|
||||
|
||||
if (process.env.DEBUG) {
|
||||
args.push('--debug');
|
||||
}
|
||||
|
||||
if (process.env.TARGET_ARCH) {
|
||||
args.push('--target_arch=' + process.env.TARGET_ARCH);
|
||||
}
|
||||
|
||||
let { status } = spawnSync('node-pre-gyp', args, {
|
||||
shell: true,
|
||||
stdio: 'inherit'
|
||||
});
|
||||
if (status) {
|
||||
if (!exit) {
|
||||
throw new Error(status);
|
||||
}
|
||||
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = main;
|
||||
|
||||
if (require.main === module) {
|
||||
main(true);
|
||||
}
|
||||
Reference in New Issue
Block a user