问题描述
我使用MPVolumeView显示Airplay图标,它工作正常。
I am using MPVolumeView for showing Airplay icon and it works fine.
但是我需要在Airplay网络出现时显示动画,并在airplay网络隐藏时隐藏该动画。
But I need to show an animation when Airplay network comes, and hide that animation when airplay network hides.
Airplay开始和结束时是否有通知让我知道?
Is there a notification that will let me know when Airplay starts and ends?
推荐答案
这正是你要找的 -
This is exactly what you're looking for - https://github.com/StevePotter/AirPlayDetector
它是一个单独的类,它提供一个属性来确定airplay设备是否处于活动状态。并在可用性发生变化时发出通知。
It is a single class that provides a property to determine whether airplay devices are active. And a notification when availability changes.
使用它很简单。比如,确定你写的可用性:
Using it is simple. Like, to determine availability you write:
[AirPlayDetector defaultDetector].isAirPlayAvailable
享受!
这篇关于在Objective-C中是否有任何检测AirPlay的通知?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!