Is there any notification for detecting AirPlay in Objective-C?

前端 未结 5 2292
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-02 11:33

I am using MPVolumeView for showing Airplay icon and it works fine.

But I need to show an animation when Airplay network comes, and hide that animation when airplay net

5条回答
  •  别跟我提以往
    2021-02-02 11:55

    This is exactly what you're looking for - https://github.com/StevePotter/AirPlayDetector

    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
    

    Enjoy!

提交回复
热议问题