Hello atef from egypt,
Thanks for using Apple Support Communities.
To help resolve this issue where your computer cannot connect to your AirPlay-enabled device, please follow the information outlined below.
If you are experiencing intermittent playback or significant network lag with AirPlay, it could be due to a weak Wi-Fi connection, interference, or the distance between the Wi-Fi router and your AirPlay-enabled device.
- Ensure that other devices aren't trying to stream to the same Apple TV at the same time.
- Ensure that your Wi-Fi router is set up with the recommended settings for the best performance.
- Certain external devices, such as microwave ovens and baby monitors, may interfere with a Wi-Fi network. Try moving or disabling these devices.
- If your wireless and wired networks are the same, try connecting your Apple TV to the router via Ethernet instead of Wi-Fi.
- Use the Wi-Fi network troubleshooting guide to resolve interference and other issues.
Temporarily disable firewalls (both network and local) and security software. Security software and firewalls may block ports that AirPlay uses to stream content. You can often resolve issues with security software by updating, correctly configuring, or uninstalling security software.
iTunes: Troubleshooting AirPlay and AirPlay Mirroring - Apple Support
Take care,
Alex H.