Note that there are some explanatory texts on larger screens.

plurals
  1. POPlayback state of MPMusicPlayer giving wrong state
    primarykey
    data
    text
    <p>My app just works like Default iPod player in iPhone. </p> <p>-> It will get all Playlists , artists, albums and songs from iPod music player. -> It works fine in less than ios 5.0, But when comes to 5.0 or more i am getting wrong playback states (some times). Please help me. </p> <p>-> This is my code when i select song from songlists, mediaItemCollection contains songslist and indexofcurrentObject is song number</p> <pre><code>- (void)updatePlayerQueueWithMediaCollection:(MPMediaItemCollection *)mediaItemCollection currentIndex:(int)indexOfCurrentObject </code></pre> <p>{</p> <pre><code>[musicPlayer stop]; if (userMediaItemCollection) { userMediaItemCollection=nil; } musicPlayer.nowPlayingItem=nil; userMediaItemCollection=[MPMediaItemCollection collectionWithItems:[mediaItemCollection items]]; [musicPlayer setQueueWithItemCollection:userMediaItemCollection]; [musicPlayer setNowPlayingItem:[[userMediaItemCollection items]objectAtIndex:indexOfCurrentObject]]; [self enablePrevAndNextButtons]; [musicPlayer play]; </code></pre> <p>}</p> <pre><code>-(void)playbackStateDidChanged:(NSNotification *)notification </code></pre> <p>{</p> <pre><code>if (musicPlayer.playbackState!=MPMusicPlaybackStatePlaying) { [playPauseButton setBackgroundImage:[UIImage imageNamed:@"play_iPad.png"] forState:UIControlStateNormal]; } else if(musicPlayer.playbackState==MPMusicPlaybackStatePlaying) { [playPauseButton setBackgroundImage:[UIImage imageNamed:@"pause_iPad.png"] forState:UIControlStateNormal]; } </code></pre> <p>}</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload