Skip to content

Commit 92f6e82

Browse files
committed
Added ICE server configuration options
Relevant to #4, so that TURN servers can be set. Also fixed the docs, which were broken by new sphinx (I think).
1 parent 4c4a9fc commit 92f6e82

File tree

6 files changed

+8
-10
lines changed

6 files changed

+8
-10
lines changed

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"sphinx.ext.intersphinx",
4848
"sphinx.ext.viewcode",
4949
"sphinx.ext.githubpages",
50-
"sphinxcontrib.asyncio",
50+
#"sphinxcontrib.asyncio",
5151
"sphinx_js",
5252
"sphinx.ext.napoleon",
5353
"sphinx_autodoc_typehints",

docs/requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
sphinx-js
2-
sphinxcontrib-asyncio
32
sphinx-autodoc-typehints
43

54
numpy

js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rtcbot",
3-
"version": "0.0.7",
3+
"version": "0.0.8",
44
"description": "",
55
"main": "dist/rtcbot.cjs.js",
66
"module": "dist/rtcbot.esm.js",

js/src/connection.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,19 @@ class RTCConnection {
5050
* For detailed documentation, see the RTCConnection docs for Python.
5151
*
5252
* @param {*} defaultOrdered
53-
* @param {*} options
53+
* @param {*} rtcConfiguration is the configuration given to the RTC connection
5454
*/
5555
constructor(
5656
defaultOrdered = true,
57-
options = {
57+
rtcConfiguration = {
5858
iceServers: [{ urls: ["stun:stun.l.google.com:19302"] }]
5959
}
6060
) {
6161
this._dataChannels = {};
6262

6363
this._msgcallback = msg => console.log(msg);
6464

65-
this._rtc = new _RTCPeerConnection(options);
65+
this._rtc = new _RTCPeerConnection(rtcConfiguration);
6666
this._rtc.ondatachannel = this._onDataChannel.bind(this);
6767
this._rtc.ontrack = this._onTrack.bind(this);
6868

rtcbot/connection.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ def subscribe(self, subscription=None):
320320
class RTCConnection(SubscriptionProducerConsumer):
321321
_log = logging.getLogger("rtcbot.RTCConnection")
322322

323-
def __init__(self, defaultChannelOrdered=True, loop=None):
323+
def __init__(self, defaultChannelOrdered=True, loop=None, rtcConfiguration=None):
324324
super().__init__(
325325
directPutSubscriptionType=asyncio.Queue,
326326
defaultSubscriptionType=asyncio.Queue,
@@ -336,8 +336,7 @@ def __init__(self, defaultChannelOrdered=True, loop=None):
336336
self._dataChannelSubscriber = SubscriptionProducer(
337337
logger=self._log.getChild("dataChannelSubscriber")
338338
)
339-
340-
self._rtc = RTCPeerConnection()
339+
self._rtc = RTCPeerConnection(configuration=rtcConfiguration)
341340
self._rtc.on("datachannel", self._onDatachannel)
342341
# self._rtc.on("iceconnectionstatechange", self._onIceConnectionStateChange)
343342
self._rtc.on("track", self._onTrack)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# This call to setup() does all the work
1111
setuptools.setup(
1212
name="rtcbot",
13-
version="0.0.7",
13+
version="0.0.8",
1414
description="An asyncio-focused library for webrtc robot control",
1515
long_description=README,
1616
long_description_content_type="text/markdown",

0 commit comments

Comments
 (0)