Resume playback after phone call?

418 views
Skip to first unread message

murphymark

unread,
May 9, 2012, 9:51:41 AM5/9/12
to Tasker
Hi,

I'm VERY new to tasker and I've managed to set up a profile where
Google Music loads and toggles pause when I insert my aux cable and
usb charger in my car. I want to be able to use my bluetooth kit to
make and receive calls in the car. So far, android pauses the music
when I get or make a call, however I can't find a way to automatically
resume playing music when the call ends. Is this possible? Also would
it be possible to set up a situation where if I'm not listening to
music before the call, that music does not then start automatically
playing? Like I said, I'm very new to this, I've looked on the tasker
wiki but I just can't seem to figure it out at all.

Any help would be greatly appreciated!

M

unread,
May 18, 2012, 6:45:02 PM5/18/12
to tas...@googlegroups.com

Generally speaking, this specific case works on my phone (GNex + CM9) without Tasker at all. If music is playing and a call comes in(or I start one), it will resume after I hangup. That said, I use AmazonMP3, so maybe Google Music does not do that.

Here is a simple way I would solve it - though as I mentioned, it may conflict with built in functionality. This will also add "InCar" variable and "PhoneInUse" variable you can use in other tasks. Lastly, this may start music in car, even if you do not have music playing. I have not found a reliable way to detect if music is playing with AmazonMP3 - but checking if %MTRACK is set may work for GoogleMusic. If that is the case, set ResumeMusic variable in PhoneInUse task only if MTRACK is set to remove that scenario. 

Profile 1: InCar
Context
  Bluetooth (your car kit bluetooth id) connected
  Headphones inserted
Enter Task:
  Set Variable InCar
  Start Google Music App,
  Wait a few secs,
  Press Pause,
  Press Pause/Play (this will guarantee it will be playing in the end even you were already playing)

Exit Task:
  Clear Variable InCar

Profile 2: PhoneInUse
Context:
  Phone Offhook
Task:
  Set Variable PhoneInUse
  Set Variable ResumeMusic  [if MTRACK is set (the if clause here is optional)]
  Press Pause if InCar (you may not need this)
 
Profile 3: PhoneNoInUse
Context:
  Phone Idle
Task:
  Clear Variable PhoneInUse
  Clear Variable ResumeMusic if not InCar (in case you left car while talking on phone)
  Press Pause if ResumeMusic
  Press Pause/Play if ResumeMusic
  Clear Variable ResumeMusic

HTH

-M
Reply all
Reply to author
Forward
0 new messages