Use AirPlay on your Mac
Show whatever’s on your iMac on the big screen using AirPlay screen mirroring—or use AirPlay to send content to your Mac from an iPhone, iPad, or even another Mac. To mirror the iMac screen on your TV screen or to use the HDTV as a second display, connect your HDTV to Apple TV and make sure the Apple TV is on the same Wi-Fi network as your iMac. You can also play web videos directly on your HDTV without showing what’s on your desktop—handy when you want to play a movie but keep your work private.
In some cases, you can use an AirPlay display even if you’re not on the same Wi-Fi network as Apple TV (called peer-to-peer AirPlay). To use peer-to-peer AirPlay, you need an Apple TV (3rd generation rev A, model A1469 or later) with tvOS 7.0 or later.
Send content to your Mac from other devices. Watch videos, listen to music, and more on your Mac while they’re being played on your other devices. Mirror your iPhone or iPad on your Mac or extend its display by using your Mac as a secondary display for apps that support it, such as Keynote and Photos. Use your Mac as an AirPlay 2 speaker to stream music or podcasts to your Mac, or use it as a secondary speaker for multiroom audio. Your Mac works with any Apple device, and it’s even easier to connect if the devices share the same Apple ID.
Play web videos without showing your desktop. When you find a web video with an AirPlay icon Use AirPlay to stream what’s on your Mac to an HDTV in the macOS User Guide. To learn more about using a second display with your iMac, see If screen mirroring or streaming isn’t working on your AirPlay-compatible device.