Webrtc DataChannel step4 does not work

Issue #28 new
Ranjani Rajagopalan created an issue

I have followed the steps given in the codelab link: https://bitbucket.org/webrtc/codelab

I was able to get the code working until something broke on Last saturday. I have made no modifications to the code.

It fails immediately after receiving answer from the client that received the offer 248: Send channel state is: closed

I see that the gotreceivechannel callback is never triggered when the ondatachannel event occurs.

Just to double check, I tried the same example from a different PC and noticed the same issue. The same code works fine in mozilla.

I have tried clearing cache/re-installing chrome but no luck! I have even reset chrome settings to make sure nothing changed in my browser.. I am able to run other examples off the internet that demo pusher+webrtc data chat.

Any help would be much appreciated.

Comments (6)

  1. klrzaidi NA

    I have the same problem but the code never worked for me ! (Send channel state is: closed)

    I also tried step7 and have the same problem. On Google chrome: sendChannel.readyState = closed (in sendData function) On firefox : sendChannel.readyState = connecting (in sendData function)

    Thank you for your help

  2. Shuo Chen

    I tried different browsers. The step4 doesn't work on Chrome 48.0.2564.97 m and works on Firefox 43.0.4.

  3. Loong Chek Jen

    For some reason, when I pass in null as optional parameters in new RTCPeerConnection it works.

    Changed lines: ... localPeerConnection = new RTCPeerConnection(servers,null); ... remotePeerConnection = new RTCPeerConnection(servers,null); ...

    The places changed is bold.

  4. Umut Ozan Yıldırım

    It seems there is a typo in the code. Rtp Should be Rtc!!!

    #!
    {optional: [{RtpDataChannels: true}]}
    

    should be

    #!
    
    {optional: [{RtcDataChannels: true}]}
    
  5. argiepiano

    Please refer to https://webrtc.org/web-apis/chrome/ . This is why adding 'null' as Loong Chek Jen pointed out works.

    Chrome also supports unreliable RTP-based data channels, and they can be activated by a { RtpDataChannels: true } constraint to the PeerConnection constructor. However, they should be considered deprecated and NOT used in new code. Chrome will remove support for RTP-based data channels at some point in the future.

  6. Log in to comment