Mobile as input - game button

for my gameshow I would like to use different team members’ mobile as a game button.
So let’s say the bleu team pushes their mobile first the screen of my hosting computer turns bleu.

Is this something that is easy to do in javascript
for a relative newbie as I am?

Any ideas…

This is not easy, and there are a lot of different options depending on your needs of connection and latency. Bluetooth itself can’t really be accessed from javascript on iOS alone (yet).

I’d say your best bet is to probably look at WebRTC for fast communication between two peers. You’ll still need a method to connect the two which means you’ll either need an intermediate server or at least an input field for IP address between the controller and game.

The other choice would be to go native, at least for the connectivity parts and then funnel the button presses into javascript.

Curious, is this a real game show or amongst friends etc…

i’d say it’s not that complicated …

google for sse (not supported IE and edge -> those’ll need a polyfill)

it’s a onedirectional messaging server to client.

possible workflow:
gamers website will post any json (e.g. {team: ‘blue’}) to a file …

gameleaders website has got a sse-setup who’s php reads that file an sends the data along …

1 Like

Yep, was why I asked the above question, as It would likely be possible to do something with Hype/App-Script on google. Likely a poll and pull by the web app. But all this really depends on how and who this is being deployed to. Which @jonathan makes valid points

sse would will rely on a stream-type and save from polling …though any serverscript could connect to a google sheet as source or database …

of course :slight_smile:

open two windows on two devices and toggle the colors … both will change … (slight delay …)

the very rudimentary setup: (13.6 KB)

for advanced usage description see:

1 Like

Or us … that is free for low volume and pretty responsive and powerful. There is a example on the forum. Search for pusher…