WebRTC Solutions Featured Article

WebRTC has Myriad of Uses beyond just Messaging

May 28, 2015

Just when you thought the ingenuity of the developer community has reached into every nook and cranny of possible places where WebRTC could be useful, you can be surprised.  Where these surprises emerge most often these days are in hackathons, and the recent mini TADHack in London produced an interesting use of WebRTC that proves the point. 

In this regard, check out the recent blog by Neil Stratford (courtesy of Alan Quayle) of who has just joined communications messaging API and WebRTC innovators Nexmo as Tech Lead. As Stratford says, “For the WebRTC themed London TADHack-mini I wanted to build something that demonstrated WebRTC in a different way, that wasn’t traditional audio or video communication.”  As can be seen from the video he certainly (pun intended) lit up the hackathon. 

His hack, WebRTC Lights, was aimed at the challenge of controlling chained LED lighting strips. As can be seen, WebRTC helped him accomplish his mission.

What was interesting about the blog was how Stratford used what could be considered the under-appreciated Data Channel, which he rightfully notes is “The perfect protocol for connecting devices on the Internet of Things. You just have to replace browsers with devices.”

For readers who are technically inclined, Stratford walks though what he did and even hinted at work to be done to make the hack even better.  The steps included:

  • Taking the RGB protocol running over the data channel and sending the values to a plugin running in the Janus gateway on the Pi.
  • Relaying the values to the microcontroller and sent to the lights.

As Stratford explains, “Once this RGB protocol is exposed to javascript the fun really starts. The Web Audio API provides a rich set of audio analysis capabilities and when combined with GetUserMedia it’s possible to take the microphone input, perform an FFT (Fast Fourier Transform) and render that on the lights. All in javascript, with low latency.”  He further notes that, “GetUserMedia provides access to the video camera, but rather than stream the video, in this case we can read individual scan lines and render them to the lights. A possible use of this is for ambient lighting that responds to room conditions, or a fun remote light viewing experience.”

Image via Shutterstock

If nothing else, this hack has the potential for making Christmas light displays even more amazing.  This includes taking full advantage of the data channel for controlling not just lights but the audio and visual capabilities of sophisticated displays as well.  As someone whose neighborhood is populated with impressive holiday multimedia displays already, what could be done in the future without the need to hire an electrician seems within near reach. 

Stratford strikes an inspiring chord in his conclusion when he says: “WebRTC is about a lot more than just audio and video. The data channel is equally exciting and it’s going to be interesting to see what the intersection of WebRTC and the Internet of Things makes possible.”

Yes it will.

Edited by Maurice Nagle

Article comments powered by Disqus