New HTML and JavaScript APIs let you add custom controls to your app that match the behavior of the standard iOS AirPlay control. When AirPlay targets are available, iOS displays an AirPlay button that invokes the AirPlay route picker, allowing the user to stream video or audio content to an Apple TV–connected device or AirPlay-enabled sound system. The button displays a distinctive visual style (currently a blue background tint) to indicate when a wireless AirPlay target is active; when no AirPlay targets are available, the button is hidden. The new APIs give you the means to match this behavior with your own custom controls.
All HTML media elements allow AirPlay streaming by default. A new Boolean attribute on <video> elements, x-webkit-wirelessvideoplaybackdisabled, lets you opt out of allowing video AirPlay for wireless targets. (Wireless audio playback is always allowed.) A corresponding property in the JavaScript HTMLVideoElement interface provides access to the same behavior from JavaScript code.