Avoid having to refresh the connection during class.
Are you using AirPlay with your iPhone or iPad?
The best way to use AirPlay to control the AppleTV is with an iPad or iPhone. With iOS devices, there should be no timing out. Check out this link to prevent the Apple TV from turning off.
Are you using AirPlay to share your laptop monitor?
If so, the issue could be the "Screen Saver" or "Energy Saver" settings in Apple System Preferences. Extend your Computer Sleep and Display Sleep settings to at least an hour long. https://support.apple.com/en-us/HT201714
Tip: Do not use your laptop to show Youtube videos. AirPlay with the laptop YouTube videos will have stuttering sound and image issues. Either use the HDMI or VGA cable to directly connect to the Sharp TV as a monitor, or use your iPhone or iPad to show the videos.
If you have further questions, or if you believe this article to be outdated, please send an email to firstname.lastname@example.org and let us know.