How does it work...like technically how does stuff go from my phone to the TV? - ProjectL/TV GitHub Wiki

There exist a communications tunnel inside the client, that tunnel is provided for via PubNub's Android Library.

Pubnub allows the creation of secure communication channels that can send and receive payloads of data up to 50kb.

So within the client there's the pubnub lib that has a subscribe key and a publish key, the lib allows access to use pubnub's servers as a gateway between distributed parts of Project L.

On the Project L backend we have processes running the pubnub python/go library in scripts. When a scene which could consist of text, an image, video, audio or all of the above, is sent from a interface such as a web app or a mobile app, that requests goes through the motions and eventually hits the server side pubnub code.

As you see here below, the code is pretty simplex.

def pub(url):
        channel = channel
        message = {
                       "action": "tv.loqoo.v4.ORIGINAL_VIDEO_SCENE",
                       "url": url,                                                                                                                                      
                       "body": "body",
                       "lchannel": lchannel,
                       "tv": tv,
                       "Locale": locale,
                       "profileNAME": "test",
                       "sceneTITLE": "test",
                       "sceneVIEWS": "test",
                       "sceneLIKES": "test",
                       "sceneDURATION": "test",
                       "scenePROVIDER": "youtubeScene"
                  }

In the code a pubnub channel is specified along with an action, a msg and meta data pertaining to the content being shared.

Each TV is a part of a Locale, a Locale is a contained environment that has a particular state, a particular set of attributes specific to it. One of those attributes is a text only phone number. That number allows users a quick and easy way to broadcast content and comments to the TVs within that Locale easily from any app on their phone via SMS.

On the client side code alot more is going on.

This JSON is being pushed from the python lib to the android lib, once the object reaches the client side its unpacked, moved into the right variables and then played through a media player instance or displayed as an ImageView.

But this is usually the last and final step of the process of publishing and broadcasting to the TV.

.