Search code examples
iphoneobjective-ciositunes

Controlling iTunes on iPhone from within an app


Hi I was just wondering if there is a library or set of methods for controlling the audio playing on an iPhone, i.e. play/pause, next/prev etc.

I can't seem to find anything, does anyone know if they exist?


Solution

  • You can use the MPMusicPlayerController from the MediaPlayer framework to play "iPod" music.

    MPMusicPlayerController *player = [MPMusicPlayerController iPodMusicPlayer];
    [player skipToNextItem];
    //...