Mirror Window

Cursor capture
Resolution (optional) ×

What is this?

This page lets you mirror a window (or your entire desktop) in a video element. This video can be played fullscreen.

Why would I want to do that?

I often give presentations wherein I want to show the audience a particular window on my desktop. At the same time, I like to have other windows open, with notes, code samples, timers, etc. I don't want the audience to see these, so I can't just mirror my screen on the external display. In many cases, the external display is behind me, so I cannot simply put the window to be shared on the external screen only. In the past, I've use xrandr tricks to make the external screen mirror only a portion of my primary screen, but this occasionally crashed my X server. With this, I can keep the window to be shared on my primary screen, while showing this window, with the mirrored content, on the external screen.

How does it work?

Web tech all the way. You may have noticed that you can do screen sharing directly from your browser. This uses the same Screen Capture API, but displays the video on the same page, rather than shipping it over the Internet. The basics of this were cribbed from this MDN example.

To start mirroring a window, press the Select Window button above. Your browser will display a dialog letting you select what to mirror. (Your exact options will depend on the browser you're using.) Once you select the window to display, video of that will be displayed on this page. Press Go Fullscreen to display the video fullscreen on the current display. Stop Mirroring returns you to this page.

Options

The Cursor capture option controls whether the mouse cursor should be captured in the video stream. Unfortunately, this option is only supported by Opera. Chrome always uses the motion setting, showing the cursor when it's moving and hiding it after a few seconds of stillness. Firefox always uses the never setting.

The video stream picks a resolution indepedent of the window being mirrored. By default, it will use the resolution of the display currently showing the window. You can override this with the Resolution options. If only one is specified, the other will be worked out from the aspect ratio of the current display.

Does it need the Internet?

Nope! The video stream is handled entirely locally, so it doesn't need any Internet connection. In fact, this page is served as a Progressive Web App, so you can load it without Internet access in the future and even "install" it on your desktop.

Where's the source?

You have it all in this webpage, basically. But if you want to contribute or report a problem, go to the GitHub project.