ACMILabs / spotlights

An interactive video player running on an Optiplex 7050.
1 stars 2 forks source link

Spotlights

An interactive video player that loads a playlist of videos from XOS specified by the XOS_PLAYLIST_ID. It autoplays by default and a user is able to select from the menu of videos to begin playing them. This is intended for use on an Optiplex 7050 with a touchscreen.

Spotlights CI

A screenshot of Spotlights running in Chromium browser.

Features

Hardware

Screen rotation

If the screen is installed upside down, use this environment variable in config.env to rotate it:

Options are: normal, inverted, left or right

We have our Spotlights connected to a Samsung PM43F-BC display. Setting ROTATE_DISPLAY also attempts to rotate the touch overlay. You can find the name of your touch overlay using xinput -list.

The scripts/x86.sh startup script includes running scripts/touch_overlay.sh in the background, which checks if the touch interface has disconnected, and re-sets the touch overlay rotation.

To disable this, add the environment variable DISABLE_TOUCH_CHECK=true.

Run a development server with docker

Run Javascript tests with docker

Run Python tests with docker

Re-build the Chromium base-image

To re-build the base-image on Docker Hub acmilabs/spotlights:v1:

If you have authentication errors, try logging out and in again with the acmi credentials:

Installation via Balena

Run with virtualenv for dev

$ virtualenv .venv
$ pip install -r requirements/prod.txt
$ cp config.tmpl.env config.env
$ mkdir .venv/data
$ echo CACHE_DIR=`pwd`/.venv/data/ >> config.env
$ env `cat config.env | xargs` python -u app/cache.py
$ env `cat config.env | xargs` python -u app/main.py

Chromium flags

Goes fullscreen, disables right clicks and devtools --kiosk

Running as root: --no-sandbox

Faster but unstable: https://software.intel.com/en-us/articles/software-vs-gpu-rasterization-in-chromium --enable-native-gpu-memory-buffers --force-gpu-rasterization --enable-oop-rasterization --enable-zero-copy

Intel Kaby Lake Graphics are blacklisted: --ignore-gpu-blacklist

All required for matching screen size: --window-position=0,0 --window-size=1920,1080 --test-type

Logging: --enable-logging=stderr --v=1

Enable html5 video autoplay without setting muted --autoplay-policy=no-user-gesture-required

Remote debug: chromium --no-sandbox --disable-gpu --remote-debugging-address=0.0.0.0 --remote-debugging-port=9222 --headless http://localhost:8080