BlackHole icon indicating copy to clipboard operation
BlackHole copied to clipboard

Play next song on hover feature on audioplayer screen

Open developer-rachit opened this issue 2 years ago • 5 comments

developer-rachit avatar Mar 15 '22 14:03 developer-rachit

I have added a feature on audioplayer.dart screen. When you hover on your smartphone song changes to next

https://user-images.githubusercontent.com/45431705/158399322-387056a5-afe7-4943-9d77-21dd92aa8bc0.mp4

.

developer-rachit avatar Mar 15 '22 14:03 developer-rachit

Looks good

shubh402 avatar Mar 15 '22 14:03 shubh402

Nice feature! Also be sure to provide a switch in the settings page if user wants to disable/enable it

BrightDV avatar Mar 15 '22 16:03 BrightDV

Nice feature! Also be sure to provide a switch in the settings page if user wants to disable/enable it

That's a good point

shubh402 avatar Mar 15 '22 17:03 shubh402

Ok, it looks good. But a few things that needs to be changed. First of all don't use setstate. I believe the song can just directly be changed using a listener which calls audioHandler.skipNext() whenever user hovers. Secondly, as @BrightDV mentioned, an option for the same in settings should be provided. Finally, a request from my side, you can track the duration of hover so that the song pauses or plays when its hovered for more than 3 or 5 seconds. And to change song when hover is less than that interval. Also, I'm not sure about that but can you even track the direction of hover? I don't think proximity sensor provides that, but if it does then you can use that to change track to next or previous one.

Sangwan5688 avatar Mar 17 '22 07:03 Sangwan5688