NERDDISCO / luminave

Operate all the lights with your web browser and create stunning visual experiences.
MIT License
76 stars 8 forks source link

Nothing is happening when luminave is in the background #108

Closed TimPietrusky closed 4 years ago

TimPietrusky commented 4 years ago

Issue description

When using luminave in the background (not the active tab, another window is maximized), nothing happens on Mac.

Steps to reproduce

Versions

  1. Browser: 75
  2. luminave: 3.1
TimPietrusky commented 4 years ago

Idea: Chrome flags

@alexanderson1993 suggested to try these options in Chrome:

chrome://flags/#expensive-background-timer-throttling
chrome://flags/#stop-non-timers-in-background

Update: July 22nd, 2019

I tried both flags while having luminave in a background tab, which resulted in nothing = No lights were updated.

TimPietrusky commented 4 years ago

The final solution (after trying Electron first, which also didn't work because of https://github.com/electron/electron/issues/9567) was to move the playback-loop (rAF wrapped inside a setTimeout) from the timeline-manager into a Web Worker, which triggers the main-loop.

Behavior

MacOS

luminave can't be in a background tab, it must be active. You can open any other application in fullscreen.

Windows

luminave can be in a background tab or minimized.