Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Send text messages browser to browser in webrtc?

Tags:

webrtc

p2p

I want to send text messages directly to browser. Till now I'm only seeing the audio/video transmission demos in the web. These are my doubts:

  • Can't we solve this just by using PeerConnection API?
  • Or is the new DataChannel API is required to achieve this?
  • If so, in which browser/browsers the dataChannel APIs are implemented?

Thanks in advance for any help..

like image 293
Nachiketha Avatar asked Jan 03 '13 04:01

Nachiketha


2 Answers

The answer to your question is: Yes - you need to use dataChannel API

Its not cross-browser as they're still implementing it - I'd probably use socket.io with node atm for a cross-browser app.

Once datachannel is done, it'll be AMAZING! :)

like image 107
harry young Avatar answered Nov 23 '22 22:11

harry young


You need to use the DataChannel part of of the PeerConnection API. This will work in firefox 18 and forward and is coming to Chrome some time soon.

A good starting point to understand how to do this is https://hacks.mozilla.org/2012/11/progress-update-on-webrtc-for-firefox-on-desktop/ and the latest draft of the specification at http://dev.w3.org/2011/webrtc/editor/webrtc.html!

like image 41
Cullen Fluffy Jennings Avatar answered Nov 23 '22 22:11

Cullen Fluffy Jennings