AVPlayer currently playing item details and volume control in iPhone?

1.1k views Asked by At

I have tried AVPlayer for playing online http streamed music file, it works fine.

What is the way to get the current playing audio track name,artist etc?
Is there any way to adjust the volume of AVPlayer while playing music (using UISlider)?

2

There are 2 answers

1
RKY On

You can adjust the volume by:

player.volume = slider.value;
4
Ravi Kumar Karunanithi On
MPMediaItem *currentItem = self.musicPlayer.nowPlayingItem;

//Display the artist, album, and song name for the now-playing media item.
//These are all UILabels.
self.songLabel.text   = [currentItem valueForProperty:MPMediaItemPropertyTitle];
self.artistLabel.text = [currentItem valueForProperty:MPMediaItemPropertyArtist];
self.albumLabel.text  = [currentItem valueForProperty:MPMediaItemPropertyAlbumTitle];