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 @@ ...@@ -10,8 +10,11 @@
<key> <string>_Access_contents_information_Permission</string> </key> <key> <string>_Access_contents_information_Permission</string> </key>
<value> <value>
<tuple> <tuple>
<string>Anonymous</string>
<string>Assignee</string> <string>Assignee</string>
<string>Assignor</string> <string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string> <string>Manager</string>
<string>Owner</string> <string>Owner</string>
</tuple> </tuple>
...@@ -24,7 +27,6 @@ ...@@ -24,7 +27,6 @@
<string>Assignee</string> <string>Assignee</string>
<string>Assignor</string> <string>Assignor</string>
<string>Manager</string> <string>Manager</string>
<string>Owner</string>
</tuple> </tuple>
</value> </value>
</item> </item>
...@@ -44,7 +46,6 @@ ...@@ -44,7 +46,6 @@
<string>Assignee</string> <string>Assignee</string>
<string>Assignor</string> <string>Assignor</string>
<string>Manager</string> <string>Manager</string>
<string>Owner</string>
</tuple> </tuple>
</value> </value>
</item> </item>
...@@ -52,8 +53,11 @@ ...@@ -52,8 +53,11 @@
<key> <string>_View_Permission</string> </key> <key> <string>_View_Permission</string> </key>
<value> <value>
<tuple> <tuple>
<string>Anonymous</string>
<string>Assignee</string> <string>Assignee</string>
<string>Assignor</string> <string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string> <string>Manager</string>
<string>Owner</string> <string>Owner</string>
</tuple> </tuple>
...@@ -106,8 +110,7 @@ ...@@ -106,8 +110,7 @@
iceServers: []\n iceServers: []\n
},\n },\n
{\n {\n
\'optional\': [{DtlsSrtpKeyAgreement: true},\n \'optional\': [{DtlsSrtpKeyAgreement: true}]\n
{RtpDataChannels: true}]\n
}\n }\n
],\n ],\n
data_channel_options = {reliable: true},\n data_channel_options = {reliable: true},\n
...@@ -136,10 +139,6 @@ ...@@ -136,10 +139,6 @@
.allowPublicAcquisition("notifyDataChannelOpened", function () {\n .allowPublicAcquisition("notifyDataChannelOpened", function () {\n
this.props.channel_defer.resolve();\n this.props.channel_defer.resolve();\n
})\n })\n
\n
.allowPublicAcquisition("notifyDataChannelMessage", function () {\n
this.props.channel_defer.resolve();\n
})\n
\n \n
.declareMethod(\'createOffer\', function (title) {\n .declareMethod(\'createOffer\', function (title) {\n
var gadget = this,\n var gadget = this,\n
...@@ -171,9 +170,6 @@ ...@@ -171,9 +170,6 @@
var gadget = this,\n var gadget = this,\n
webrtc = this.props.webrtc;\n webrtc = this.props.webrtc;\n
return webrtc.createConnection.apply(webrtc, connection_options)\n return webrtc.createConnection.apply(webrtc, connection_options)\n
.push(function () {\n
return webrtc.createDataChannel(title, data_channel_options);\n
})\n
.push(function () {\n .push(function () {\n
return webrtc.setRemoteDescription(description);\n return webrtc.setRemoteDescription(description);\n
})\n })\n
...@@ -265,9 +261,7 @@ ...@@ -265,9 +261,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>action</string> </key> <key> <string>action</string> </key>
<value> <value> <string>publish_alive</string> </value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>actor</string> </key> <key> <string>actor</string> </key>
...@@ -293,7 +287,7 @@ ...@@ -293,7 +287,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1439906478.8</float> <float>1440161500.96</float>
<string>GMT</string> <string>GMT</string>
</tuple> </tuple>
</state> </state>
...@@ -302,7 +296,7 @@ ...@@ -302,7 +296,7 @@
</item> </item>
<item> <item>
<key> <string>validation_state</string> </key> <key> <string>validation_state</string> </key>
<value> <string>draft</string> </value> <value> <string>published_alive</string> </value>
</item> </item>
</dictionary> </dictionary>
</list> </list>
...@@ -338,7 +332,7 @@ ...@@ -338,7 +332,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>945.9516.40380.20821</string> </value> <value> <string>945.18037.6464.41250</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -356,7 +350,7 @@ ...@@ -356,7 +350,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1439908875.61</float> <float>1440430718.64</float>
<string>GMT</string> <string>GMT</string>
</tuple> </tuple>
</state> </state>
......
...@@ -199,6 +199,12 @@ ...@@ -199,6 +199,12 @@
\n \n
}\n }\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 \n
rJS(window)\n rJS(window)\n
.ready(function (g) {\n .ready(function (g) {\n
...@@ -211,6 +217,8 @@ ...@@ -211,6 +217,8 @@
\'notifyDataChannelOpened\')\n \'notifyDataChannelOpened\')\n
.declareAcquiredMethod(\'notifyDataChannelMessage\',\n .declareAcquiredMethod(\'notifyDataChannelMessage\',\n
\'notifyDataChannelMessage\')\n \'notifyDataChannelMessage\')\n
.declareAcquiredMethod(\'notifyDataChannelClosed\',\n
\'notifyDataChannelClosed\')\n
\n \n
.declareService(function () {\n .declareService(function () {\n
/////////////////////////\n /////////////////////////\n
...@@ -242,16 +250,17 @@ ...@@ -242,16 +250,17 @@
.declareMethod(\'createConnection\', function (configuration, constraints) {\n .declareMethod(\'createConnection\', function (configuration, constraints) {\n
this.props.connection = new RTCPeerConnection(configuration, constraints);\n this.props.connection = new RTCPeerConnection(configuration, constraints);\n
this.props.connection.onicecandidate = deferOnIceCandidate.bind(this);\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
\n \n
.declareMethod(\'createDataChannel\', function (title, options) {\n .declareMethod(\'createDataChannel\', function (title, options) {\n
// XXX Improve to support multiple data channel\n // XXX Improve to support multiple data channel\n
this.props.channel = this.props.connection.createDataChannel(title, options);\n this.props.channel = this.props.connection.createDataChannel(title, options);\n
\n listenToChannelEvents(this);\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
// console.log("Channel type: " + this.props.channel.binarytype);\n // console.log("Channel type: " + this.props.channel.binarytype);\n
})\n })\n
\n \n
...@@ -447,7 +456,7 @@ ...@@ -447,7 +456,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>945.9471.8579.37853</string> </value> <value> <string>945.18239.14794.40840</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -465,7 +474,7 @@ ...@@ -465,7 +474,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1439905903.84</float> <float>1440432050.86</float>
<string>GMT</string> <string>GMT</string>
</tuple> </tuple>
</state> </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