Do you mean that it is the airplay mirror that is not working but normal airplay does? If all on same network, apple id etc than it could be interference from a household appliance such as a microwave. This is often the case with intermittent mirroring. Does yours work at all?
Go to the Apple menu > System Preferences > Displays and check the checkbox in the lower left corner of the window that reads 'Show mirroring options in menu bar when available'. This will do as it states. AirPlay Mirroring is really the only AirPlay option for the OS X itself. Hope that helps.