Welcome to the Apple Community.
Intermittent problems are often a result of interference. Interference can be caused by other wifi networks in the neighbourhood or from many household electrical items.
You can download and install iStumbler to help you see which channels are used by neighbouring networks so that you can avoid them, but iStumbler will not see household items that cause interference.
Refer to your router manual for instructions on changing your wifi channel or adjusting your multicast rate (which may help where interference is present. You might also try moving the Apple TV away from other electrical equipment.
There are other types of problems that can affect networks, but this is by far the most common, hence worth mentioning first. Networks that have inherent issues can be seen to work differently with different versions of the same software or from device to device, so just because it worked before or works with a different device doesn’t exclude interference as a problem.
The following article(s) may help you.
Troubleshooting Wi-Fi networks and connections
Recommended Wi-Fi settings
Sources of Interference
Wifi Diagnostic Software (for Mac users)
You may also find some help on this page, where I’ve collected some of the more unusual solutions to network issues.
I understand that some of the suggested software (whilst once free) has become pay-ware, I suggest you look around, you may find free alternatives.
A frequent cause of consistent failure to enable AirPlay or HomeSharing at all, is the service being blocked on the network. Make sure your network isn't hidden, has a unique name, that MAC address authentication is disabled, security is set to use WPA 2 Personal and that there is only one router/device acting as a DHCP server and providing NAT services.
Make sure your router/computer allows access over the following ports
TCP 3689 & TCP/UDP 5353
Refer to your router manual/manufacturer for any settings that are specific to that model.
Another frequent cause of consistent failure to enable AirPlay or HomeSharing at all, is security software, in many cases configuring it correctly, disabling it or even uninstalling it can help, but in some cases, the security software can cause problems that simply reconfiguring, disabling or uninstalling cannot reverse.
If you are consistently unable to activate AirPlay or HomeSharing, have tried all the steps in this article and have security software installed on your system, you might benefit from contacting its provider or participating in any online forums they run to discuss the matter with them.