Build your own RasPiTV with Node.js & Socket.io

Post on 22-Nov-2014

1.205 views 2 download

description

This workshop was given at Lamba Labs Beirut First Hackerspace and the talk was given at LebGeeks Event. If you'd like to bypass this presentation and jump into the fun stuff, you can always fork the code on Github: https://github.com/DonaldDerek Or check the tutorial on: blog.donaldderek.com

Transcript of Build your own RasPiTV with Node.js & Socket.io

Build Your own RasPiTV

DerekHaddadDonaldDerek

The idea.

= + +RaspberryPi Chromium NodeJS + Socket.ioRasPiTV

The Implementation.

RasPiTv with its special remote controller

The Stack

• Raspbian• NodeJs– Express– Socket.io– Omxcontrol

• Shell Commands– Chromium in Kiosk mode– Youtube-dl– Omxplayer

WARNING: Diving into Code

Socket.io: Client Side

Client Side Implementation (remote.html)

Socket.io: Server Side

Server Side Implementation (app.js)

Moustache.js – Template Engine

The template

Creating the JSON object and filling in the template

The Remote

Minimal remote – Buttons are replaced with Swipe Gestures

Quo.js – Handling Swipe Gestures

The $$ is to differentiate jQuery from Quo

The TV

Swipe right on the remote to move the border from Watch to Listen

https://github.com/DonaldDerek/RaspberryPiTV

Fork me on github

Check the full tutorial on: blog.donaldderek.com

DerekHaddadDonaldDerek

May the Force be with you

DerekHaddadDonaldDerek