Reputation: 317
So basically I want to stop the iPod music when my app loads up. What would be the best way to do this?
Upvotes: 0
Views: 823
Reputation: 3152
You should use this method to get access to the iPod App player:
+ (MPMusicPlayerController *)iPodMusicPlayer;
Than you just stop it using the appropriate method.. like this:
MPMusicPlayerController *player = [MPMusicPlayerController iPodMusicPlayer];
[player stop];
You should also add the MediaPlayer framework
Upvotes: 2
Reputation: 3592
You need to add MediaPlayer.framework
to your target.
In your AppDelegate.m
import MediaPlayer/MediaPlayer.h
and add this in the
application: didFinishLaunchingWithOptions:
method:
[[MPMusicPlayerController iPodMusicPlayer] stop];
Upvotes: 4