theothernt / AerialViews

A screensaver for Android TV devices including Nvidia Shield, Fire TV, and Chromecast with Google TV. Inspired by Apple TV's video screensaver.
GNU General Public License v3.0
469 stars 35 forks source link

Pressing Play on ShieldTV remote does not dismiss screensaver #15

Closed fexofenadine closed 2 years ago

fexofenadine commented 3 years ago

I have a ShieldTV, and if I pause a video (in Kodi), wait for Aerial Dream to start, then press play on the remote, the video starts but the screensaver continues to run over the top.

If I press the back button it cancels the screensaver. No other button seems to cancel it that I can find.

Ideally, pressing play should both start the video and cancel the screensaver.

I believe the original (prefork) version had solved this issue.

Thanks!

Charlsburg commented 3 years ago

It's because this version has the ability to skip to the next video with the right direction control - but agree it would be great if all other buttons cancelled the screensaver. +1 this request

theothernt commented 3 years ago

Ah, good find @fexofenadine

The app is only supposed to be listening for right-button (ie. next) on the d-pad/remote but it seems trap those other buttons too. Should be easy enough to fix!

theothernt commented 3 years ago

If you were curious about the cause of the issue...

When I wanted to add the 'skip to next video' option I have to listen for a button/key press. By default, an Android screensaver app will exit if any key is pressed. So I turned this off. I wait for the button to be pressed, skip to the next video. If any other key is pressed, ignore it but pass it on - meaning, if there is an app running behind the screensaver, it will use the button press I ignored - but the screensaver would not exit.

So now, if the play button is pressed, the screensaver will exit and the app running behind will receive the play event. After a bit of testing, it should be in the next build with a few other bug fixes.

fexofenadine commented 3 years ago

Awesome, thanks for the explanation too :)

theothernt commented 3 years ago

The new release is out now to test... https://github.com/theothernt/AerialDream/releases/tag/0.98.2-preview

This contains the fix mentioned above but it does raise the question... should the screensaver quit when any media buttons (play, pause, forward, etc) is pressed and should I only listen for up, down, left, right and OK ?

fexofenadine commented 3 years ago

It's still doing it on my system - is it possible that the Play button on a Shield is a different keycode to what you were expecting?

I don't know if it's relevant but the only buttons that affect Aerial on my setup are Right, which advances to the next video as expected, and Back (not left), which exits the screensaver.

To answer your question, yes it would be great if any button but Right dismissed Aerial :)

fexofenadine commented 3 years ago

Ok, on Shield it looks like the keycode is MEDIA_PLAY_PAUSE rather than MEDIA_PLAY, is that possibly the issue?

theothernt commented 3 years ago

Ok, on Shield it looks like the keycode is MEDIA_PLAY_PAUSE rather than MEDIA_PLAY, is that possibly the issue?

Thanks for looking into the issue - in the next update I'll probably just 'reserve' a few direction keys and anything else will exit the app.

fexofenadine commented 3 years ago

Perfect, thanks so much!

Charlsburg commented 3 years ago

Just tested with v0.98.2 and I can still press almost every button including play and the screensaver won't cancel, even with media resuming behind the screensaver

theothernt commented 3 years ago

Just tested with v0.98.2 and I can still press almost every button including play and the screensaver won't cancel, even with media resuming behind the screensaver

In the next update, the app will quit with any keypress except for the direction arrows + ok

theothernt commented 2 years ago

@fexofenadine the latest build is out with the above fix... https://github.com/theothernt/AerialViews/releases/tag/0.99-preview