Making a few changes on your Apple TV settings app can help prevent strangers from gaining unauthorized access to your AirPlay connection.

AirPlay is one of the best features of Apple which allows you to share videos, music, photos, and other types of content from your Mac, iPhone, or iPad to your Apple TV. You can also use AirPlay to stream content to speakers or compatible smart TVs like LG or Samsung.

However, some Apple TV users find it annoying that its default settings allow strangers nearby to connect to your AirPlay. This presents a problem particularly if you live in dense locations like condominiums or an apartment block.

Default AirPlay settings allow anyone within Wi-Fi range to discover your Apple TV and may attempt to AirPlay to it. If you are enjoying your time at home, sitting comfortably on your couch or chair, and trying to enjoy some TV shows, it is definitely irritating to be constantly disturbed by AirPlay connection dialogs.

Making a few simple changes in the settings can help you prevent neighbors or total strangers from connecting to your AirPlay on Apple TV. Doing so will allow you to enjoy shows without getting interrupted by connection dialogs asking you for access.

To make changes, open the Settings app on your Apple TV. Then select AirPlay & HomeKit and choose Allow Access. From there, you can change the default setting "Everyone" to "Anyone on the Same Network."

This setting shows your AirPlay option only to people with devices connected to the same Wi-Fi network where your Apple TV also connects. Having this setting prevents people nearby from connecting to your AirPlay connection on Apple TV and also stops the bothersome PIN code request from unexpectedly popping up.

Guests visiting your home who wished to use the AirPlay on your Apple TV will need permission for them to be on your Wi-Fi network. You can further make the access more restrictive when you configure HomeKit settings on your Apple TV.

There is an option there that allows "Only People Sharing This Home" to use AirPlay. This means only those who are nearby and were able to set up their user profiles in the Home app can AirPlay to your Apple TV. This setting is particularly useful if you do not want your guests to freely use AirPlay but allow them WiFi access.

These settings apply to all HomeKit speakers and Apple TVs. You can also customize the settings to so it will be on a per-device basis on our Apple TV whenever the "Allow Nearby to AirPlay" shows up on the screen. You can also turn this setting off if you do not want others connecting to your AirPlay on Apple TV.