As Apple said in iOS 9.3 we can Access Apple Music Library. I am playing it from my application by MPMusicPlayerController
.
I am getting wrong playbackState. For Ex. If song continue playing - so it should return status MPMusicPlaybackStatePlaying
but gettting other enum values. My code is
if ([[MPMusicPlayerController systemMusicPlayer] playbackState]==MPMusicPlaybackStatePlaying)
{
}
else
{
NSLog(@"playbackState %ld",(long)[[MPMusicPlayerController systemMusicPlayer] playbackState]);
}
As apple saying here we have following possible vales -
Values for the playbackState property.
Declaration
Objective-C
enum {
MPMusicPlaybackStateStopped,
MPMusicPlaybackStatePlaying,
MPMusicPlaybackStatePaused,
MPMusicPlaybackStateInterrupted,
MPMusicPlaybackStateSeekingForward,
MPMusicPlaybackStateSeekingBackward
};
typedef NSInteger MPMusicPlaybackState;
How will I get the correct state of current playing song . Any Idea, If I mistaken something please let me know. Thanks