When I tried to use Airplay to make my TV a second display, the TV went blank. None of the mirroring options were shown in the Airplay menu. I called Apple support, but Airplay mysteriously started working during the call. Yesterday, the problem was back. I found the solution in an Apple support community post. There seems to be a bug in El Capitan that prevents Airplay from being used as a second display if there is an invalid login item.
My TV is connected to a 3rd generation Apple TV running Apple TV software version 7.2. My computer is a mid-2013 MacBook Air running OS X El Capitan Version 10.11.3.