Adobe made it possible to initiate Peer-to-peer video chat among two users, without need of a server in-between with use of Adobe flash & AIR platform alone. Same p2p communications are possible with HTML5, and it just gets easier.
Peer-to-peer streaming i.e. voice/video frames are streamed directly between peers, without any server in between is actually possible with HTML5 specification. The result is lower latency and optimal network utilization.
Checkout the demo of HTML5 P2p communications below by ericsson:
ConnectionPeer API is under works for establishing direct connection between two peers, which is web browsers in this case. ConnectionPeer is a very thin protocol as it shunts out signaling and connection stuff to traditional HTTP.
ConnectionPeer establishes peer-to-peer connectivity, using the following steps:
- Each peer sends out its own reachability information using the getLocalConfiguration method.
- Next, they add the information about the other peer (obtained typically over HTTPS from the chat server) using addRemoteConfiguration method.
- Next, p2p connection is established, allowing for streaming data to be exchanged between the peers. When established, an onConnect event is generated and allows the application to respond with the data it wants to send out. ConnectionPeer includes methods for streaming data over the connection. These are used to add real-time voice and video streams and even HTML5 p2p file transfers.
The ConnectionPeer works almost everywhere, whether you are behind proxy, NAT or firewall. Whether you are on a desktop browser or a mobile (Android, iPhone, Blackberry), it doesn’t care, works on all WebKit browsers.
The good part of the whole story is that IETF and W3C are standardizing this peer-to-peer support in browsers to enable real-time voice and video communication without plug-ins.
Swarmplayer is one of the examples of doing HTML5 p2p video. It adds a P2P transport protocol to Firefox that allows <video src=”p2p://” > functionality. P2P transport is BitTorrent compatible.