Playing a real slot machine from a browser · Codelabs
RU|EN|KK
← All cases
CASE 06Live video and remote equipment control

Playing a real slot machine from a browser

A person opens the site and sees live video of a real slot machine standing in a hall. They press a button on the screen — and it is pressed on the machine itself: the signal goes from the browser to the server, from the server to the board inside the cabinet, and the board closes the contact. The reels spin, the camera shows the result, the money is counted exactly as it is for a visitor standing in the hall. We did everything here: from the board firmware to the client that shows the video.

VideoElectronicsWebRTC

How it works

Here we built the whole vertical: from the AVR firmware of the video capture board to a Unity client with a native video decoder.

The player sees the machine over WebRTC through Janus: 1998 streams, a screen and a camera for each of about a thousand machines. If WebRTC cannot get through, a fallback path of MPEG over WebSocket takes over.

A press travels from the browser over WebSocket to a C++ board server, and from there to our own network board inside the machine: an ATmega128 with a hand-written network stack, because the ready-made one did not fit into the microcontroller memory. The board closes the contacts of the buttons and the touchscreen. Credits and payouts are accounted through the SAS industrial protocol — the same one the machine uses to talk to the hall.

In numbers

  • ·about 1000 machines online
  • ·1998 simultaneous video streams
  • ·our own board and our own firmware inside the machine

Describe your task — we will tell you what part of it we have already built