# Windows and frames

Make the player draw in one part of a PC's output, turn it for a sideways panel, split it into frames that each play their own bookings, and book into a frame.

> **Note:** Windows and frames are in Mestra Player 1.0.3. A screen gets them when it updates, on its own update setting. Until then it keeps playing full screen. See [Updates and reliability](https://withmestra.com/docs/player/updates-and-reliability/#updates).

By default the player fills the whole display of the PC. A **window** makes it draw in one part of the output instead, and can turn the picture. **Frames** split that window into areas that each have their own bookings. This page covers setting both up and booking into them.

Setting a window is for owners. Editors and owners can add frames and book into them.

## What a window is

A window is the part of the PC's output the player draws in. A screen has either:

- **Full screen**, the whole desktop, or
- a window: a position, a size and a rotation, in pixels.

Two uses:

- **An LED processor.** The processor takes a part of the PC's output as its input. The window is that part.
- **A portrait panel driven sideways.** The PC sends a landscape picture and the panel is turned on its side. A window with a rotation draws the picture the right way up for the people looking at it.

The "desktop" is the PC's primary monitor. Position is counted from its top left.

### Rotation

**Rotation** is **0°**, **90°**, **180°** or **270°**. The picture is made at the window's *turned* size, then turned to fill the window. For a 90° or 270° turn the width and height swap. A window of 768 × 1296 turned 90° plays pictures of 1296 × 768.

The turned size is the size Mestra uses everywhere else: for the screen's size, for the check on a file's shape, and for frames. A screen with a window shows its screenshots and its standby picture cropped to the window.

## Set a window

A window belongs to a **panel profile**, and a screen follows the profile it is linked to. Change the profile and every screen that uses it follows.

1. Open the **⋯** menu on the **Screens** page and choose **Panel profiles**.
2. To make a profile that only carries a window, select **New profile** and choose **No panel control (window only)** as the **Protocol**. To add a window to a profile you already have, open it with **Edit**. A built-in profile can't be edited: use **Copy** first.
3. In the **Window** card, choose **A window**.
4. Enter **X**, **Y**, **Width** and **Height** in whole pixels, and choose the **Rotation**. Sides are 16 to 16384 pixels.
5. Select **Save**.

Then link the screen to the profile. Open the screen's **⋯** menu, choose **Panel and hours**, and under **Panel link** pick the **Panel profile**. See [Link a panel](https://withmestra.com/docs/player/screens/#link-a-panel). A window-only profile asks for no connection.

To go back to the whole display, choose **Full screen** in the profile's **Window** card.

### When a window changes

If screens already follow the profile, Mestra asks **Change the window?** It names the screens, the window now and the window after, and shows a picture of each. Their bookings and frames are checked first. Select **Change the window** to go on.

Mestra refuses a change, and saves nothing, when:

- a booking on the screen's whole window would no longer fit the new size;
- a frame would lie outside the new window;
- the screen is in a group and the change would resize it. See [Groups](#groups).

The page lists what is in the way. End or change those bookings, or move the frames, and save again.

### A window that isn't on the desktop

If a window is outside the primary monitor, the player can't draw in it. The screen plays **Full screen** with its frames dropped, so only whole-window bookings play. The screen's activity shows a `window_invalid` event. A window on a second monitor counts as off the desktop. Fix the profile's window so it lies inside the primary monitor.

## Frames

A frame is an area inside a screen's window. Each frame has its own bookings, like a small screen of its own. Use frames to show a menu in one area and a promotion in another, or to split a tall panel in three.

A screen with no frames plays its whole window as one place.

### Add, resize and remove frames

On the screen's page, open the **Window and frames** fold. Its line says where the screen's window comes from, for example "from its panel profile LED wall (768 × 1296, turned 90°)". A drawing shows the window and each frame in it. Frames are measured in pixels from the window's top left, in the turned window.

1. Select **Add a frame**. A new frame is called **Frame 2**, **Frame 3** and so on, and starts as big as the whole window. Rename it in **Name**.
2. Set **X**, **Y**, **Width** and **Height**. The drawing follows as you type.
3. Set **Layer**. A frame with a higher layer is drawn over one with a lower layer. Frames can overlap.
4. Choose which frame has sound with the **Sound** buttons, or **None**. See [Sound](#sound).
5. Select **Save frames**.

To resize or move a frame, change its numbers and select **Save frames**. To remove one, select **Remove** on its row, then **Save frames**.

Rules:

- A name is 1 to 60 characters, and no two frames on a screen have the same name.
- A frame must lie wholly inside the window. Mestra says "Frame *name* is outside the window." and won't save.
- A frame is 16 to 16384 pixels a side, and its layer is 0 or more.
- **Save frames** stays off until every number is filled in.
- A frame that has live or draft bookings can't be removed, and can't be resized so a booking no longer fits. Mestra lists the bookings so you can end them first.
- If someone else changed the frames while you were editing, the save is refused and **Reload the frames** appears. Your edits stay until you reload.

If the window changes later, the frames stay where they are, in pixels from the window's top left, and the change is refused if any would fall outside.

## How frames and whole-window items take turns

A frame and a whole-window booking can't be on screen at the same time. The screen plays in two phases, one after the other:

- **Frames phase.** Every frame plays its own bookings, each in its own loop.
- **Whole-window phase.** The bookings made on **Whole screen** play, one at a time.

Details:

- A whole-window item never starts while a frame is part way through a booking.
- A frame whose bookings are all played waits, showing the [stop show](#the-stop-show), until the frames phase ends.
- The frames stay on screen until the first whole-window item has loaded.
- Adding frames to a screen that is playing lets the whole-window loop finish its current round first.

## Sound

A screen has one speaker, so only one frame can have sound. While frames play, sound comes from that frame only, and the other frames are silent. With **None** chosen, every frame is silent.

Sound still follows your panel and booking settings. It is off unless an owner turns it on, and a booking with no volume is muted. See [Sound](https://withmestra.com/docs/player/showing-content/#sound).

## The stop show

A frame that has nothing to play, or has finished its bookings and is waiting for its turn to end, shows the screen's stop show. The stop show is fitted inside the frame without cropping. See [When a screen is stopped](https://withmestra.com/docs/player/screens/#when-a-screen-is-stopped).

## Book into a frame

In **Book content**, step **Where** lists a screen with frames under its own name, with a choice for **Whole screen** and one for each frame. Pick any mix of them, and other screens and sites too. A frame is named after its screen, such as **Lobby · Left**, wherever Mestra shows it: on the booking, in the schedule and in the loop.

- A frame is a place with its own size. A file goes there only if its shape matches the frame.
- A place that can't take a file says why under the list. Mestra says "a different shape, so it can't be booked there" when the file can never fit.
- A frame plays pictures, video and HTML5. An HTML5 package is scaled to fill its frame.
- Bookings on different frames of one screen play at the same time. Bookings on one frame play in turn, in its loop.

### Scale to fit

If a file is the same shape as the place but another size, Mestra won't book it until you tick **Scale to fit** beside it. The message says the file and the place sizes. If the file is much smaller than the place, it adds that the picture may look soft. A file of a different shape is never offered **Scale to fit**.

The same rule applies when a window or a frame changes size under bookings that exist: a booking made without **Scale to fit** that no longer matches in size stops the change.

### The decode check

Several videos at once can be more than a PC decodes. When you pick a video for a place, Mestra adds up the load of the video and of the heaviest video on each other frame of the screen, against what the PC has measured it can decode. The frames play together, so they are added. A whole-window item never plays with frames, so it is judged on its own.

| Result                           | What Mestra shows                                                                                                                                                                                              | What you can do                                                              |
| -------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
| Under 80% of what the PC decodes | Nothing                                                                                                                                                                                                        | Book it.                                                                     |
| 80% to 100%                      | "*Screen* would be near its decoding limit with this video (*N* %)."                                                                                                                                           | You can still book it. The PC is close to its limit.                         |
| Over 100%                        | "*Screen* can't decode this video beside what its other frames play…", or, for a video that is too heavy alone, "*Screen* can't decode this video (… pictures a second it has measured). Book a lighter file." | The place can't be picked. Book a lighter file, or leave it off that screen. |
| The PC hasn't measured the codec | "*Screen* hasn't measured its decoding yet, so this layout isn't checked."                                                                                                                                     | Nothing is refused. Book it and check the screen when it plays.              |

A video is judged at the size of its place, not the size of its file: a 4K video in a small frame counts as a small video. A file that doesn't say its frame rate is counted at 30 fps. The measurement comes from the PC's [decode report](https://withmestra.com/docs/player/showing-content/#the-decode-report).

## Groups

A screen group (a video wall of one PC per screen) works with windows, with these rules. See [Screen groups and video walls](https://withmestra.com/docs/player/video-walls/#windows-on-group-members).

- A member's size is its **turned** window. All members must have the same turned size.
- A member can be turned.
- A screen in a group can't have frames. Leave the group first.
- Changing a window so a member's size changes is refused, because the wall's size was fixed when the member joined. Moving the window, or turning it by 180°, keeps the size and is allowed.
- If every member of a group follows the same profile, changing that profile's window resizes the whole group together. The group's bookings must still fit the new size.

## Limits to know

- Only a named screen has a window or frames. A screen that has no name yet, and a group, don't.
- A window is on the primary monitor. See [A window that isn't on the desktop](#a-window-that-isnt-on-the-desktop).
- Changing a profile's window changes every screen that follows it, at once.
- Frames can overlap, and the higher layer is drawn on top.
- Only one frame has sound.
- A frame can't hold a booking that doesn't fit it. Resize the frame, or end the booking first.

See also: [Run your screens](https://withmestra.com/docs/player/screens/), [Put content on your screens](https://withmestra.com/docs/player/scheduling/) and [Show content on your screens](https://withmestra.com/docs/player/showing-content/).
