Different networks
Check that both devices use the same Wi‑Fi network and that client isolation is not blocking local discovery.
AirPlay can send video, audio or an entire screen from an Apple device to Apple TV or a compatible television. Steps vary by app, iOS or iPadOS version and the TV’s AirPlay support.

AirPlay can send video, audio or an entire screen from an Apple device to Apple TV or a compatible television. Steps vary by app, iOS or iPadOS version and the TV’s AirPlay support.
Open Control Centre, choose Screen Mirroring and select the compatible television. If a code appears on the TV, enter it on your Apple device. Screen mirroring shows the entire interface; some apps may restrict certain content for rights or compatibility reasons.
Check that both devices use the same Wi‑Fi network and that client isolation is not blocking local discovery.
Open the TV settings and check that AirPlay is enabled and incoming requests are allowed.
Some VPNs and guest networks can block local discovery. Test on a standard home network.
Restart both devices and install available updates.
Apple explains network requirements and the process in its AirPlay guide for iPad and its iPhone streaming guide.
AirPlay compatibility depends on the Apple TV or television model, the iOS or iPadOS version and the app in use. Check Apple’s documentation and the screen manufacturer’s specifications.