MPMusicPlayerController deprecated with iOS 6
Asked Answered
R

1

5

I've just seen iOS 5.1 to iOS 6.0 API Differences released by Apple. They say that some important methods of MPMusicPlayerController.h are removed to MPMediaPlayback protocol (play, pause, stop...).

Does somebody know how to update my application who use the code below to work with the iOS 6?

MPMusicPlayerController *musicPlayer = [MPMusicPlayerController iPodMusicPlayer];
musicPlayer play;
Reynolds answered 12/6, 2012 at 14:32 Comment(3)
In the past, unreleased versions of iOS were under NDA...that is probably true with iOS 6, but I haven't looked to be sure. You should probably ask this question on Apple's Developer Forums.Begot
I think the dev-forums are down.Schoolmaster
Thanks T Reddy, the Apple's Developer Forum is actually down, I will ask it when I can.Reynolds
L
10

The MPMusicPlayerController class conforms to the MPMediaPlayback protocol, and calling [MPMusicPlayerController iPodMusicPlayer] returns an instance of MPMusicPlayerController. Moreover, all the deprecated methods that were removed from the MPMusicPlayerController class are present in the MPMediaPlayback protocol. What this means is that:

  1. No changes should be required for your code to work under iOS 6. The play method still exists for every MPMusicPlayerController instance, and calling it should do the same thing that it always has.

  2. No methods have actually been "removed". They were moved into a protocol, presumably because having an abstraction of a media player API allows for very cool things to be done by providing custom object implementations that conform to the MPMediaPlayback protocol.

Laoag answered 12/6, 2012 at 23:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.