cjb / serverless-webrtc

A demo of using WebRTC with no signaling server.
Other
1.54k stars 239 forks source link

Doesn't work on Chrome #1

Closed cjb closed 10 years ago

cjb commented 11 years ago

Chrome doesn't support "reliable" (TCP) datachannels yet, but that's not the only reason this app doesn't work in Chrome. It would be great to at least fix the other reasons.

bscranton commented 11 years ago

Chrome's security model doesn't normally allow any access to local devices/files from a "file://" URL. Adding "--allow-file-access-from-files" to the Chrome command line will let you get the offer and answer strings. Of course it still fails because Chrome doesn't support reliable data channels yet.

cjb commented 11 years ago

Thanks for the comment, @bscran. I don't get a PeerConnection even when running the source under "python -M SimpleHTTPServer 8080", even with unreliable data channels, so there's something about the ICE negotiation that needs to be fixed up before we get to these other problems.

ken-okabe commented 10 years ago

Hi, I also created a similar serverless WebRTC test site for my learning curve and others.

http://webrtcdevelop.appspot.com/

My code works with Chrome with "reliable" DataChannel flag true. I think the reason your code does not work with Chrome is Line157 pc1.onconnection = handleOnconnection;

which never fired on Chrome

(cf.) chrome RTCPeerConnection event not fire after connected http://stackoverflow.com/questions/17784780/chrome-rtcpeerconnection-event-not-fire-after-connected

onconnection is not part of the interface in the latest standard, so that's probably why it's not implemented in Chrome: http://dev.w3.org/2011/webrtc/editor/webrtc.html#interface-definition.

The code in Firefox lists onconnection as a Mozilla extension: https://github.com/mozilla/mozilla-central/blob/master/dom/webidl/RTCPeerConnection.webidl#L98.

Having said that, I stack where DataChannel send never works with Firefox. Chrome works fine on the other hand. I observe your code also fails with DataChannel send with Firefox.

Please investigate my code(only 150lines), and do you have any idea on these? Thanks.

cjb commented 10 years ago

Looks like Chrome works here now, and Chrome/Firefox interop works too.