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:
- start audio session
- be prepared handle whatever system does
Comments
Post a Comment