Search code examples
javascripthtmlnode.jsweb-applicationswebos

peer to peer (p2p) connection between smart tv and smartphone


So, I program for a couple of years now and I only programmed websites. However, I wanted to make a Web App for my LG TV and already downloaded the SDK, ide, emulator, etc.. And it was pretty easy to get a basic App that works fine. I also used PhoneGap (used to make mobile apps with HTML, CSS, js, node js) to do the same App for my android phone.

So my problem is that I need a way to get p2p (peer to peer) connections between my tv and my smartphone. I want to do a simple game, where the tv is used as a monitor and the phone as a controller. However, I don't want to use a web server. You should be able to play it, without an internet connection, but with a wifi network.

I already looked for WebRTC, but I didn't understand how it works, to be honest. I also read something about socket io. From what I have understood is, that the tv needs to run an HTTP-server and then the phone needs to connect to it? But then, the smartphone somehow needs to know the IP of the HTTP-server. Otherwise, you would have to type the IP every time you want to play.

I don't need a finished code, just a point where I can start and an explanation.

Thanks!


Solution

  • Turns out, there is something called ConnectSDK which solves my problem (It works not only with LG TV's but also with 7 different platforms). The SDK is made by LG, however it took me 8 months to find it.

    Why? Because LG is not telling you about this SDK on their own page for TV developers... Even though creating a websocket server on the phone and make the TV join this server by manually typing the ip works, however ConnectSDK provides a much better user experience.

    It feels like they don't want that people programm good apps for their TV's.

    LG communication skills: 1/10