<分区>
Apple 发布 access to the iPod Library在 iPhone SDK 3.0 中,我想知道现在是否可以了解当前正在播放的歌曲?标题、艺术家、专辑就足够了。示例:用户打开一个应用程序,该应用程序可以知道在后台播放的歌曲。
有没有人有这方面的经验?
非常感谢!
<分区>
Apple 发布 access to the iPod Library在 iPhone SDK 3.0 中,我想知道现在是否可以了解当前正在播放的歌曲?标题、艺术家、专辑就足够了。示例:用户打开一个应用程序,该应用程序可以知道在后台播放的歌曲。
有没有人有这方面的经验?
非常感谢!
最佳答案
MPMediaItem * song = [[MPMusicPlayerController iPodMusicPlayer] nowPlayingItem];
NSString * title = [song valueForProperty:MPMediaItemPropertyTitle];
NSString * album = [song valueForProperty:MPMediaItemPropertyAlbumTitle];
NSString * artist = [song valueForProperty:MPMediaItemPropertyArtist];
关于iphone - 在 iPhone 上 : Find out what song is currently playing?(在 iPod 音乐播放器中),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1917014/