title: How to programmatically discover the iOS devices list and Connect for mirroring using airplay?
body: <p>I want to create an application, where user didn't know about the discovery of nearby devices (like iphone, ipad and appletv, etc)and select the only appleTv, if available in nearby then connect atomically and start mirror. For this I read the <strong>AirPlay</strong> :  </p>
  
  <blockquote>
    <p>Using AirPlay, users redirect audio and video from iTunes or an
    iOS-based device to either an Apple TV (and from there to a home
    theater system) or to an AirPlay-enabled sound system. AirPlay can
    stream media coming live from the Internet, media already stored in
    iTunes, or media stored on an iOS-based device. AirPlay can stream
    Internet-based media when it is playing in iOS apps, in the Safari
    browser on iOS-based devices, or in iTunes on any platform</p>
  </blockquote>
  
  <p>but i have no need the airplay button, i want to programmatically discover device and connect only with appleTv , after that start mirroring. </p>
  
  <p>I read many blogs and googled a lot, but didn't find anything useful. <a href="http://spin.atomicobject.com/2012/04/23/ios-mirroring-and-programmatic-airplay-selection/" rel="noreferrer">http://spin.atomicobject.com/2012/04/23/ios-mirroring-and-programmatic-airplay-selection/</a>    gives some explanation, but it's appear.</p>
  
  <p>Please give me the suggesstion, How to achieve this kind of stuff in a great manner. </p>