Use AirPlay with Apple devices
AirPlay is the Apple technology for streaming photos, video, or audio—and for mirroring from Apple devices to Apple TV. Mirrored content could be content that’s on the device, or live streams of what’s happening on the device screen. To use AirPlay, devices don’t need to be on the same network, or on any network at all.
A device can discover Apple TV using Bonjour discovery, Bluetooth IP address advertisement, or peer-to-peer discovery.
Devices prefer peer-to-peer discovery but typically establish a connection using the method that’s the most responsive or the one most recently used.
Bonjour is the Apple standards-based network technology designed to help devices and services discover each other on the same network. For example, iPhone and iPad devices use Bonjour to discover AirPrint-compatible printers and other devices, and Mac computers use Bonjour to discover AirPlay-compatible devices such as Apple TV. Some apps also use Bonjour for peer-to-peer collaboration and sharing.
Although Bonjour is most commonly used to discover services and devices on smaller networks, it can also be configured for use on larger networks by using a Bonjour gateway or similar technology. Networks using such features for AirPlay should be configured to advertise both _airplay._tcp and _raop._tcp services. And even though it’s possible to use advanced DNS configurations for advertising some Bonjour services on enterprise networks, AirPlay requires live device discovery.
macOS and Bonjour for Windows clients can also use the conventional unicast Domain Name System (DNS) to discover services being advertised in any accessible domain anywhere in the world. Using DNS to discover services outside your local network is known as Wide-Area Bonjour.
Bonjour works by using multicast traffic to advertise the availability of services. Because multicast traffic is usually not routed across subnets, it requires Apple TV devices and AirPrint printers to be on the same IP subnet as the iPhone and iPad devices and Mac computers that use them. For small networks, this approach is the norm.
Bluetooth Low Energy advertisement
Apple TV also broadcasts its AirPlay capabilities using a Bluetooth Low Energy (BTLE) advertisement that contains the IP address of the Apple TV (Apple TV HD uses Bluetooth version 4 and Apple TV 4K uses Bluetooth version 5). Apple devices within close proximity of the Apple TV, generally within the same room, hear those advertisements and attempt to establish an AirPlay session over the existing network. This method doesn’t use Bonjour, nor does it require that both devices be on the same network. As long as the devices are within Bluetooth range to hear the advertisement and there are no firewalls restricting access from the source device to the Apple TV, this method should work. To find the model number of an Apple TV, see the Apple Support article Identify your Apple TV model.
iPhone, iPad, Mac, and Apple TV devices have the ability to do peer-to-peer discovery. This is used for more than just AirPlay. AirDrop, Continuity, and other device-to-device technologies take advantage of the same technology.
When looking for other devices, an Apple device broadcasts a very small Bluetooth advertisement indicating that it’s looking for peer-to-peer services. When any peer-to-peer-capable device hears this BTLE packet, it creates or joins a peer-to-peer network directly between the devices. The devices concurrently switch between this temporary network and any infrastructure networks they were on before in order to deliver both the AirPlay video stream and provide existing internet service. The temporary network typically operates on Wi-Fi channel 149+1, but depending on the hardware involved, may also include channel 6, or channel 149,80. The devices follow the same frequency use rules on the temporary network as they do with any other Wi-Fi connection to avoid disrupting any existing infrastructure networks that might already be using those channels.
Important: Some countries and regions may set their own regulations for channel 149. For more information, check the 5 GHz section of the List of WLAN channels wikipedia webpage. Where use of channel 149 isn’t allowed, the temporary peer-to-peer network operates on Wi-Fi channel 44, and in most of Europe, on Wi-Fi channel 42.
It’s also important to note that neither device requires an association with an existing infrastructure network for peer-to-peer discovery to work, though it’s encouraged for software updates and internet-provided content. Peer-to-peer AirPlay requires the following hardware:
Apple TV HD with tvOS 9.0 or later, or Apple TV 4K with tvOS 11.0 or later
iPhone, iPad, and Mac computers from late 2012 or later using the latest version of their operating system
Apple TV also contains a setting that allows you to choose—or manage with a mobile device management (MDM) payload—how users connect:
Everyone can use AirPlay: Users connect over peer-to-peer or the infrastructure network to Apple TV.
Anyone on the same local network can use AirPlay: Only users on the same local network can AirPlay to Apple TV.
Off: AirPlay is disabled, and users won’t be able to AirPlay to Apple TV.
AirPlay uses AES encryption to help ensure that content is protected when mirroring or streaming from an iPhone, iPad, or Mac to an Apple TV.
You can restrict AirPlay access to Apple TV by setting a one-time onscreen passcode to ensure that Apple devices are securely paired to Apple TV. You set the requirement by going to Settings > AirPlay > Security and turning on Require Device Verification. The Apple device must then authenticate on the initial AirPlay connection. Device verification is useful when Apple TV is deployed on an open Wi-Fi network.
After the initial AirPlay connection, subsequent connections don’t require a passcode unless onscreen code settings are enabled.
Note: Restoring an Apple TV or a previously paired Apple device to factory settings resets the initial connection condition.
Peer-to-peer AirPlay is always secured with the setting Require Device Authentication. This setting, which can’t be configured by the user, prevents any nearby unauthorized users from accessing an Apple TV.
The use of passcodes or onscreen codes is recommended for any Apple TV placed in a public environment. Using passcodes prevents unauthorized users from connecting, requires the user to be in the room (in view of the screen), and prevents another user from interrupting and taking over an AirPlay session.
You can use your MDM solution to restrict which AirPlay destinations are available to a supervised device and to prepopulate the passcode a device uses to connect to an Apple TV.
Follow these setup recommendations for the best possible AirPlay experience:
Apple TV should be connected to Ethernet if available.
Important: Apple TV should always be connected to Ethernet when using Dynamic Frequency Selection (DFS) channels on the Wi-Fi network, and peer-to-peer AirPlay is desired.
Mount the Apple TV with the rubber side touching the surface it’s mounted to and with few or no obstructions between it and the other device.
Any objects between the two devices could interfere with the Bluetooth Low Energy (BTLE) or Wi-Fi signals. Mounting the Apple TV in a cabinet, behind a TV, above a projector, or in the ceiling could degrade the signal between the devices. Ideally, the Apple device should be within 25 to 30 feet of the Apple TV.
If possible, avoid using Wi-Fi channels 149 and 153 in rooms where peer-to-peer AirPlay is frequently in use.
Though the devices share airtime fairly with the infrastructure network, removing any conflicting traffic from the room improves the stability of the AirPlay session. The Apple TV HD and Apple TV 4K can also use an 80 MHz wide 802.11ac channel at 149,80 if the device streaming to it is also 802.11ac capable, though the increased throughput available with 802.11ac makes airtime contention less of a concern.