busybox11 / NowPlaying-for-Spotify

A Spotify Connect visualizer
https://nowplayi.ng
GNU General Public License v3.0
185 stars 23 forks source link

Add wakelock on fullscreen to prevent screen from sleeping #83

Closed AsterisMono closed 8 months ago

AsterisMono commented 8 months ago

I want to start by saying thank you for creating such a fantastic "Now Playing" app! I've been using it to turn my spare tablet into a dedicated music monitor, and it works beautifully.

However, I encountered a small hurdle: after a while of inactivity, the tablet dims and eventually goes to sleep, requiring me to interact with it to wake it back up. While I can adjust the power settings to prevent this, I remembered a handy JavaScript browser API called Wake Lock that could potentially handle this for us.

In my specific use case, I'd love for the app to stay awake when in fullscreen mode. Therefore, I implemented this functionality in the pull request. Of course, I'm open to discussing different approaches!

busybox11 commented 8 months ago

Hi!

Thank you for your amazing comment and contribution! For some reason the wakelock is not needed on my end. It probably comes down to the specific implementation of some browsers on some devices. Wakelock API seems more supported than when I started this project, that's nice to see.

Nice catch, I appreciate your contribution a lot :)