Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML5 + JS enough for LAN communication?

I've been brainstorming a webapp idea, something a la Turntable.fm but for LANs, that way all the computers on the SAME network aren't all downloading a song at the same time (killing bandwidth) but rather streaming the music around. The basic functionality would be for the "master" PC (the one with speakers) to play a local song or receive the songs over LAN and then play them.

My question is if there is a way for an HTML5 page (hosted online) to use JS to detect LAN users and communicate to each other directly without the need of any central server? Example case to make it clear:

Office LAN has 2 users, Bob and Bill
Bob enters lanmusic.com
Bill enters lanmusic.com
Internet dies, LAN is fine.
Bob can still detect via the page that local user Bill is on the page too
Bill sends a song to Bob through the page directly
Bob plays song with page's javascript music player

So key points:

  • Javascript/HTML5 only
  • Doesn't depend on internet except for initial load of web app
  • Can detect LAN users, make LAN connections
like image 281
Brian Avatar asked Dec 21 '11 03:12

Brian


2 Answers

Please read this blog and another article published by W3C with title Web Real-Time Communications

This functionality is still in the process by W3C and the Candidate Release for this functionality will be out in Q4 2012. So it won't be available soon.

For the time being, as an alternative my suggestion are

  1. using the Offline Capabilities of HTML5 as an alternative, which described in this presentation by Google Make it work offline.

  2. using Adobe Cirrus Beta. It can embedded inside your HTML, and it supports P2P conversation and P2P content delivery.

    • Traditional

    Cirrus1 http://labs.adobe.com/technologies/stratus/images/evolution1.jpg

    • Cirrus 1

    Cirrus1 http://labs.adobe.com/technologies/stratus/images/evolution2.jpg

    • Cirrus 2

    Cirrus2 http://labs.adobe.com/technologies/stratus/images/evolution3.jpg

like image 85
Rudy Avatar answered Oct 20 '22 04:10

Rudy


First of all, about every browser will give an error if internet connection is lost. HTML5 can take care if this problem.

But then you can only use client site js, which will not allow to do the things you want to do. Why dont you make a normal desktop application? Me an some friends are making an CLI-based application to que music to a central server, that server has the speakers and will play the music. Our github: https://github.com/Infogroep/mpgc

There are plenty of other aps out there that do the same: check out XBMC

FYI: what you could do as well is create an ad hoc network that doesnt rely on a central server. But that is still something that is beeing researched (i.e. http://soft.vub.ac.be/amop/ )

w3c has an interesting paper on Home Networking Implementation for HTML5 http://www.w3.org/2011/09/webtv/papers/W3C_HNTF_Position_Paper_Sept_2011.pdf

and check out a html5 websocket api http://dev.w3.org/html5/websockets/

like image 1
rik.vanmechelen Avatar answered Oct 20 '22 05:10

rik.vanmechelen