Commit 01dbfeca authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] Do not manually create a data channel on the receiver.

It is automatically created and provided by the ondatachannel event listener.
This bypasses some Chrome bugs.
parent a61949f5
......@@ -10,8 +10,11 @@
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
......@@ -24,7 +27,6 @@
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
......@@ -44,7 +46,6 @@
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
......@@ -52,8 +53,11 @@
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
......@@ -106,8 +110,7 @@
iceServers: []\n
},\n
{\n
\'optional\': [{DtlsSrtpKeyAgreement: true},\n
{RtpDataChannels: true}]\n
\'optional\': [{DtlsSrtpKeyAgreement: true}]\n
}\n
],\n
data_channel_options = {reliable: true},\n
......@@ -136,10 +139,6 @@
.allowPublicAcquisition("notifyDataChannelOpened", function () {\n
this.props.channel_defer.resolve();\n
})\n
\n
.allowPublicAcquisition("notifyDataChannelMessage", function () {\n
this.props.channel_defer.resolve();\n
})\n
\n
.declareMethod(\'createOffer\', function (title) {\n
var gadget = this,\n
......@@ -171,9 +170,6 @@
var gadget = this,\n
webrtc = this.props.webrtc;\n
return webrtc.createConnection.apply(webrtc, connection_options)\n
.push(function () {\n
return webrtc.createDataChannel(title, data_channel_options);\n
})\n
.push(function () {\n
return webrtc.setRemoteDescription(description);\n
})\n
......@@ -265,9 +261,7 @@
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<none/>
</value>
<value> <string>publish_alive</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
......@@ -293,7 +287,7 @@
</tuple>
<state>
<tuple>
<float>1439906478.8</float>
<float>1440161500.96</float>
<string>GMT</string>
</tuple>
</state>
......@@ -302,7 +296,7 @@
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>draft</string> </value>
<value> <string>published_alive</string> </value>
</item>
</dictionary>
</list>
......@@ -338,7 +332,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>945.9516.40380.20821</string> </value>
<value> <string>945.18037.6464.41250</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -356,7 +350,7 @@
</tuple>
<state>
<tuple>
<float>1439908875.61</float>
<float>1440430718.64</float>
<string>GMT</string>
</tuple>
</state>
......
......@@ -199,6 +199,12 @@
\n
}\n
\n
function listenToChannelEvents(gadget) {\n
gadget.props.channel.onopen = deferDataChannelOnOpen.bind(gadget);\n
gadget.props.channel.onclose = deferDataChannelOnClose.bind(gadget);\n
gadget.props.channel.onmessage = deferDataChannelOnMessage.bind(gadget);\n
gadget.props.channel.onerror = deferErrorHandler.bind(gadget);\n
}\n
\n
rJS(window)\n
.ready(function (g) {\n
......@@ -211,6 +217,8 @@
\'notifyDataChannelOpened\')\n
.declareAcquiredMethod(\'notifyDataChannelMessage\',\n
\'notifyDataChannelMessage\')\n
.declareAcquiredMethod(\'notifyDataChannelClosed\',\n
\'notifyDataChannelClosed\')\n
\n
.declareService(function () {\n
/////////////////////////\n
......@@ -242,16 +250,17 @@
.declareMethod(\'createConnection\', function (configuration, constraints) {\n
this.props.connection = new RTCPeerConnection(configuration, constraints);\n
this.props.connection.onicecandidate = deferOnIceCandidate.bind(this);\n
var context = this;\n
this.props.connection.ondatachannel = function (evt) {\n
context.props.channel = evt.channel;\n
listenToChannelEvents(context);\n
};\n
})\n
\n
.declareMethod(\'createDataChannel\', function (title, options) {\n
// XXX Improve to support multiple data channel\n
this.props.channel = this.props.connection.createDataChannel(title, options);\n
\n
this.props.channel.onopen = deferDataChannelOnOpen.bind(this);\n
this.props.channel.onclose = deferDataChannelOnClose.bind(this);\n
this.props.channel.onmessage = deferDataChannelOnMessage.bind(this);\n
this.props.channel.onerror = deferErrorHandler.bind(this);\n
listenToChannelEvents(this);\n
// console.log("Channel type: " + this.props.channel.binarytype);\n
})\n
\n
......@@ -447,7 +456,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>945.9471.8579.37853</string> </value>
<value> <string>945.18239.14794.40840</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -465,7 +474,7 @@
</tuple>
<state>
<tuple>
<float>1439905903.84</float>
<float>1440432050.86</float>
<string>GMT</string>
</tuple>
</state>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment