kmrmediaremotenowplayingapplicationisplayingdidchangenotification notificatoin不起作用
我正在尝试使用Mediaremote框架在Mac上访问音乐状态。我试图以这种方式获得游戏状态:
NotificationCenter.default.addObserver(self,
selector: #selector(onChange),
name: Notification.Name("kMRMediaRemoteNowPlayingApplicationIsPlayingDidChangeNotification"),
object: nil)
但是,如果我尝试播放和停止音乐,则方法不会被调用。 我不知道我是否必须做其他事情,因为Mediaremote是一个私人框架。
I'm trying to use the MediaRemote framework to get access to music status on my mac. I tried to get the playing status in this way:
NotificationCenter.default.addObserver(self,
selector: #selector(onChange),
name: Notification.Name("kMRMediaRemoteNowPlayingApplicationIsPlayingDidChangeNotification"),
object: nil)
but if i try to play and stop the music the method onChange doesn't get called.
I don't know if i have to do anything else due the fact that MediaRemote is a private framework.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
找到了解决方案,实际上要收到通知我必须称之为此方法
Found the solution, actually to get notified i had to call this method