If you like to work with a music video playing in the background or watch your favorite sports team while perusing social media or maybe if you simply like doing two things at once, picture-in-picture (PiP) can be really useful. It lets you pin a small window showing a video within a larger window on your computer or TV screen.

If you’re using a Mac, you can easily set up PiP for a YouTube video using either Apple’s Safari or Google’s Chrome browsers as well.

This first time, on how to have PiP on Safari, is courtesy of a great tweet by Ricky Mondello.

PiP using Safari

Right click twice on the YouTube Video. The first click will get you a menu that lets you copy the URL of the video, embed the code, or do other YouTube-related tasks. The second click will get you a more traditional menu.

Click on “Enter Picture in Picture.” Your video will shrink down to a much smaller size.

Open a new tab on your browser (or several, if you want) and go to another site — or you can leave the browser entirely. The video will keep playing.

To control the video, hover your cursor over the video. You can pause and restart it, take it out of PiP mode, or close the window entirely.

To move the small video window around, you can press down with one finger on your touchpad and use the other finger to move the window around your screen. If you’re using a mouse, then use the Command key.

There are a couple of other ways you can start PiP.

While your video is playing, right click on the volume icon in the tab; the menu will include the “Enter Picture in Picture” command. (Note: You won’t see the volume icon if you pause the video.)

If you have a Touch Bar, use the PiP icon (it looks like a small filled-in rectangle over a larger clear rectangle).

PiP using Chrome

After this article was published, a reader wrote me and asked why I hadn’t also included the way to do PiP using Google’s Chrome browser on a Mac. So I did a bit of research and found that you can have PiP on your Mac using Chrome — and it works almost exactly the same way that Safari does, except you can either use the built-in method (courtesy How-To Geek) or a Google PiP extension.

Use the built-in feature:

Right click on the YouTube video you want to make into a PiP

As with Safari, the first menu you’ll get will be YouTube’s right-click menu. So right click again (outside of the menu). You’ll get a Chrome menu with a “Picture in Picture” selection; click on that.

Again, as with Safari, the PiP functionality is pretty basic; you can move the video anywhere around the screen, pause it, and return it to its YouTube window. However, don’t expect to get any captions with it; the captions will continue to run on the original YouTube page.

Use Google’s PiP extension:

There is no perceivable advantage to using the extension over the built-in right-click feature; both give you the same simple (but effective) PiP feature.

In the Chrome Web Store, find the Picture-in-Picture extension. Click on the “Add to Chrome” button.

You will be asked for permission to “Read and change all your data on the websites you visit”

Once the extension is installed, you can access it either by clicking on the new PiP icon to the right of your address field or hitting the option+P keys.

That’s it! Enjoy your video.

Update June 23rd, 2020, 10:08AM ET: This article was originally published on December 27th, 2019, and it has been updated to include instructions on PIP in Chrome.