Here's how you can set up a password or code to control who can broadcast content via AirPlay on your Apple TV.
1. Go to Settings on your Apple TV.
2. Go to AirPlay.
3. Toggle the Onscreen Code switch to on if you want to use that option. Whenever someone tries to use AirPlay, he or she will have to enter the code on their device before AirPlay will work.
4. Click the Set Password option if you prefer to use that, and the user will have to enter your password before AirPlay will begin broadcasting content.
AirPlay is a terrific convenience, but it can also be a dreadful nuisance if you have unwanted content being broadcast in your home by kids, visitors or even neighbors. So it's worth it to take the time to limit access to AirPlay on your Apple TV.
Read more: iLounge