如何检测通过iPod中的歌曲播放 [英] How to detect a song playing by iPod

查看:153
本文介绍了如何检测通过iPod中的歌曲播放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能以编程方式找出的iPod库乐曲的详细信息,如果我的应用程序允许播放背景音乐的iPod?
有的喜欢:

Is it possible programmatically find out a song details of iPod library if my app allows playing background iPod music? some like:


start "My app"
if (iPod music playing)
{
song.details == playing.music.details"
}

我甚至不不知道如何确定的是,如果任何一首歌曲是由iPod上播放。
任何想法?

I don't even have no idea how to determinate if is any song is playing by iPod. Any idea?

推荐答案

这还挺简单:


MPMusicPlayerController *musicPlayer = [MPMusicPlayerController iPodMusicPlayer]];

NSLog(@"Playing %@", [[musicPlayer nowPlayingItem] valueForProperty:MPMediaItemPropertyArtist]);

这篇关于如何检测通过iPod中的歌曲播放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆