TVLukeProductions / TrashPlay

Other
3 stars 0 forks source link

stop playback if another app receives audio focus #11

Open phibo23 opened 9 years ago

phibo23 commented 9 years ago

http://developer.android.com/training/managing-audio/audio-focus.html

TVLuke commented 9 years ago

Used that exact developer-page, decided that ducking is cooler than stoping. I am not willing to write an app that stops playback if someone actually starts another music app (I have tested the apps on my phone and apparently neither is anyone else). If a user actually intents to start a second full-time music playing app, he/she should just close the one currently playing the music.

So, the process is only relevant for notifications, and in that case I though, ducking (turning it down, but not turning it off) is just much cooler and implemented since 1.0.7

phibo23 commented 9 years ago

stopping if another app gets focus (for something that is longer than a notification) and continuing if the focus returns is expected behaviour (at least for someone who also uses iOS). BeyondPod does exactly that. VLC ducks for TrashPlay (which sounds very weird) but stops for BeyondPod and YouTube.

TVLuke commented 9 years ago

hmm... will have to look into this. Because there is only one way to request focus (per audio context)... so how does VLC know? Anyway, whats the scenario here? Why would anyone even do that? Ever?

phibo23 commented 9 years ago

listening to trashplay music while surfing the webz, clicking a link to youtube or any other media that has audio. And I just tested youtube in chrome: BeyondPod stops, VLC ducks. And Chrome does not return focus to previous owner if you pause youtube video. ^^

TVLuke commented 9 years ago

Ok. I'll just leave this bug report here for when I'm not busy actually fixing critical bugs on this thing. Anyway, probably not chromes fault but the other guys. If you stop playing audio the focus is released automatically, you just have to catch that event and remember what the volume was previously... which works like almost all the time for trash play (and I have not been able to understand why it does not work all the time)