ios - Play Audio from other apps -


so when launch app, want able tell when music app playing (system, soundcloud, pandora, spotify, etc).

i able this:

bool isotheraudioplaying = [[avaudiosession sharedinstance] isotheraudioplaying]; if (isotheraudioplaying){     nslog(@"playing music"); }else{     nslog(@"not playing music"); } 

and able play/pause ipod music player following code:

[[mpmusicplayercontroller systemmusicplayer] play]; [[mpmusicplayercontroller systemmusicplayer] pause]; 

however, works if using default ios music app.

if listen music app (soundcloud example). code not work. still play/pause ios music app.

question:

is there way of playing/pausing music being played regardless of app?

matt correct, have no control on whether other audio paused or not. have to:

  1. start audio session
  2. be prepared handle whatever system does

how system resolves competing audio demands


Comments

Popular posts from this blog

node.js - Using Node without global install -

How to access a php class file from PHPFox framework into javascript code written in simple HTML file? -

java - Null response to php query in android, even though php works properly -