On 10/20/2013 10:31 AM, getify wrote:
Thanks so much for clarifying the whole caller/receiver semantics around data 
channels. I've read dozens of different sites and demos around webrtc and never 
picked up on that detail. Need Moar Better Docs! :)

I always point people at data_test.html, and DataChannels have been discussed on hacks.mozilla.org:
https://hacks.mozilla.org/2013/07/webrtc-and-the-early-api/
(though that has a mis-statement or two).

A mostly working (simple) example linked to from a comment in that article:
http://louisstow.github.io/WebRTC/datachannels.html

It has one serious bug: it doesn't set success/error callbacks for setLocalDescription() or setRemoteDescription(), which happens to work on FF (though perhaps only due to timing) and fails when I try it on Chrome (again likely due to a race condition). Fix that (wait for setRemoteDescription to succeed before createAnswer(), for example), and it should work cross-platform I think.

Slightly out-of-date (you don't need a dummy audio stream on FF since 23(?), no coverage of Chrome SCTP data channels) but overall pretty good (and some libraries to back it): https://www.webrtc-experiment.com/docs/rtc-datachannel-for-beginners.html


So, I implemented the change, and now FF works! Hooray.

Great!


But, it broke Chrome (Canary). In fact, in a stunning turn of irony, it broke 
Chrome in the same symptomatic way that FF was previously broken. That is, both 
sides appear to have the Data Channel (the caller onopen fires and the receiver 
ondatachannel fires). BUT, sending data across the channel, it never gets to 
the other side now, whereas before data flowed freely in Chrome when there were 
two channels.

Odd... They are actively working on this and there are still some rough edges, but absolutely hit them up.


I know this isn't a Chrome support forum, so now I guess I get to shift my question over 
to their "support".

But it's still just a major bummer for us devs (even knowing how "bleeding edge" this 
stuff is) that it's so hard to get code that works in both browsers. I know data-channels are 
"new" but they HAVE been around for a year now and it's still just so painful. :)

I agree we need better documentation and good, cross-platform examples (like apprtc.appspot.com is for a/v calls) - especially now that Chrome is moving to the standard.

Most of these examples and several others show up on a Google search for "webrtc datachannel examples". I suggest noting the dates; for example the html5rocks hit in the search is from July 2012.

--
Randell Jesup, Mozilla
_______________________________________________
dev-media mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-media

Reply via email to