malformed rtcbundlepolicy in chromium 53 / 54 after update janus.js

518 views
Skip to first unread message

Firas Abd Alrahman

unread,
Jul 15, 2017, 10:15:46 PM7/15/17
to meetecho-janus
1 - Android 7, chromium 53 (crosswalk) 
2 - Desktop windows 10 chromium 54

I am using latest: janus.js, adapter.js, janus compile.

It was working well before update.

I found the code part from chromium regarding this error: 
    RTCBundlePolicy bundlePolicy = RTCBundlePolicyBalanced;
   
String bundlePolicyString;

   
if (DictionaryHelper::get(configuration, "bundlePolicy", bundlePolicyString)) {
       
if (bundlePolicyString == "max-compat") {
            bundlePolicy
= RTCBundlePolicyMaxCompat;
       
} else if (bundlePolicyString == "max-bundle") {
            bundlePolicy
= RTCBundlePolicyMaxBundle;
       
} else if (bundlePolicyString != "balanced") {
            exceptionState
.throwTypeError("Malformed RTCBundlePolicy");
           
return 0;
       
}
   
}



Also to solve that I modified janus.js line 1306 to this

 
if(adapter.browserDetails.browser === "edge" || window.navigator.userAgent.indexOf('Chrome/54') != -1 ||         window.navigator.userAgent.indexOf('Chrome/53') != -1) {
     
// This is Edge, enable BUNDLE explicitly
     pc_config
.bundlePolicy = "max-bundle";
 
}

I did not find an efficient way to differ chromium from chrome, and do not know if problem exists in older chrome versions.

Lorenzo Miniero

unread,
Jul 16, 2017, 4:22:32 AM7/16/17
to meetecho-janus
Mh but in the master version of janus.js we only set the bundlePolicy property if the user passes it when initializing, otherwise we don't set it at all. Can you use the master version of janus.js and provide the PeerConnection configuration we print on the JS console before it's used to create the object? https://github.com/meetecho/janus-gateway/blob/master/html/janus.js#L1260

L.

Firas Abd Alrahman

unread,
Jul 16, 2017, 7:24:43 PM7/16/17
to Lorenzo Miniero, meetecho-janus
Hi;
I confirmed using the latest janus.nojquery.js file.


JSON.stringify(pc_constraints);
"{"optional":[{"DtlsSrtpKeyAgreement":true}]}"


JSON.stringify(pc_config)
"{"iceServers":[]}"


WebRTC error: 
Object {code: undefined, name: "TypeError", message: "Failed to construct 'RTCPeerConnection': Malformed RTCBundlePolicy"}

error@janus.audio.mic.js?_=:91
(anonymous function)@janus.js?_=:1728





--
You received this message because you are subscribed to the Google Groups "meetecho-janus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to meetecho-janus+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Eng. Firas Abd Alrahman
Khartoum, Sudan, Alriad, 60 St.
Mobile : +249126712777
Phone  : +249123334569
              

Lorenzo Miniero

unread,
Jul 17, 2017, 3:11:29 AM7/17/17
to meetecho-janus, lmin...@gmail.com
You still haven't provided the output of the line I mentioned, though.

L.

Firas Abd Alrahman

unread,
Jul 17, 2017, 2:33:35 PM7/17/17
to Lorenzo Miniero, meetecho-janus
  1. {optionalArray(1)}
    1. optional:Array(1)
      1. 0:
        1. DtlsSrtpKeyAgreement:true
        2. __proto__:Object
      2. length:1
      3. __proto__:Array(0)
    2. __proto__:Object

Firas Abd Alrahman

unread,
Jul 17, 2017, 2:36:16 PM7/17/17
to Lorenzo Miniero, meetecho-janus
Inline images 2

Firas Abd Alrahman

unread,
Jul 17, 2017, 5:54:08 PM7/17/17
to meetecho-janus
A user just reported the same error on chromium 55, I included Chrome/55 to the statement.

Lorenzo Miniero

unread,
Jul 18, 2017, 3:12:16 AM7/18/17
to meetecho-janus
The line you pasted confirms that we don't set any bundlePolicy at all, so not sure why the stack should complain. It should simply use the default one, as it always did.

L.

Firas Abd Alrahman

unread,
Jul 18, 2017, 1:58:47 PM7/18/17
to meetecho-janus
Yes I am sure no bundlePolicy, maybe chromium want you to set something ?
here is a test for audioroom demo on chromium 55, so I can not blame my code.

Inline images 3




tam vu

unread,
Jul 21, 2017, 2:21:31 AM7/21/17
to meetecho-janus
Hi Lorenzo,

my janus streaming plugin have the same error. This is my debug :



thanks!



Vào 14:12:16 UTC+7 Thứ Ba, ngày 18 tháng 7 năm 2017, Lorenzo Miniero đã viết:

István Ferenc Tóth

unread,
Sep 22, 2017, 9:54:24 AM9/22/17
to meetecho-janus
Hi Lorenzo

I got the same message with Cordova 7.0.1 - Crosswalk and newest janus.js-videoroomtest.js

István Ferenc Tóth

unread,
Sep 22, 2017, 10:22:22 AM9/22/17
to meetecho-janus
Hi all

Looks like this error generated by adapter.js

Firas Abd Alrahman

unread,
Sep 22, 2017, 2:00:32 PM9/22/17
to István Ferenc Tóth, meetecho-janus
I modified the line 1304 in janus.nojquery.js to be 

        if (adapter.browserDetails.browser === "edge" ||
            window.navigator.userAgent.indexOf('Chrome/53') != -1 ||

            window.navigator.userAgent.indexOf('Chrome/54') != -1 ||
            window.navigator.userAgent.indexOf('Chrome/55') != -1

        ) {
            // This is Edge, enable BUNDLE explicitly
            pc_config.bundlePolicy = "max-bundle";
        }

find adapter.browserDetails.browser === "edge"  in janus.js (jquery version) and modify.

I hope they include this fix it in the next release, it is in chromium (crosswalk) 54-55 


--
You received this message because you are subscribed to the Google Groups "meetecho-janus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to meetecho-janus+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

István Ferenc Tóth

unread,
Sep 22, 2017, 5:12:19 PM9/22/17
to meetecho-janus
Dear

I modify the file and still get error - in the pastebin you'll see the Janus console result.


The interesting part is: 

- There is a result, but could not parse...

janus.nojquery.js:370 200: Could not parse response, error: TypeError: Failed to construct 'RTCPeerConnection': Malformed RTCConfiguration, text: {...

Can you tell, which version of janus, videoroom.js and adapter.js you use, as well as cordova, and crosswalk versions?

At me: latest janus and adapter.js, and 7.0.1 cordova, latest crosswalk and Android SDK 25




To unsubscribe from this group and stop receiving emails from it, send an email to meetecho-janu...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

saul diaz

unread,
Oct 3, 2017, 1:07:22 PM10/3/17
to meetecho-janus
We tested from 49 to 61... happens from 49 to 54 and stopped happening after 54.

adding pc_config.bundlePolicy = "max-bundle"; fix the issue in those browsers
Reply all
Reply to author
Forward
0 new messages