我需要知道如何获得关于哪个播放器正在stream式传输的信息(player,spotify,napster …)
我可以得到当前正在播放的歌曲的信息(艺术家,专辑,标题):
let t = MPMusicPlayerController().nowPlayingItem?.title
当从iOS音乐播放器播放音乐时,它工作正常。 但是,当stream媒体来自其他来源(Spotify,Napster,Youtube,Tuneinradio等)时,我无法获取信息。 我怎样才能得到这个信息的任何应用程序?
使用MPNowPlayingInfoCenter.defaultCenter()
的nowPlayingInfo
字典:
let t = MPNowPlayingInfoCenter.defaultCenter().nowPlayingInfo[MPMediaItemPropertyTitle]
MPNowPlayingInfoCenter
类参考这里 。