When AirPlay is enabled in a MPMoviePlayerController, it displays a text “This video is playing on device name “. When using AirPlay with an AVPlayer, is there any way to programatically get the device name?
When AirPlay is enabled in a MPMoviePlayerController, it displays a text This video is
Share
After searching in other frameworks to get the name of the Apple TV you’re connected to, I finally found this information in the AudioToolbox framework. There may be other ways to get this, but so far I have not found another way. Hope this helps.
You’ll need to import the AudioToolbox framework:
and then a method to call when you want to detect if airplay is available