---
title: videomodeconfiguration
slug: develop/videomodeconfiguration
docTags: 
createdAt: 2025-03-27T16:58:55.219Z
---

The *videomodeconfiguration&#xA0;*&#x6F;bject allows you to configure the video resolution and retrieve video output settings. 

**videomodeconfiguration IDL**

```javascript
interface VideoModeConfiguration {
    Promise<ModeList> getAvailableModes();
    Promise<Mode> getBestMode(String connector);
    Promise<Mode> getActiveMode();
    Promise<Mode> getConfiguredMode();
    Promise<SetModeResult> setMode(Mode mode);
	Promise<SetModeResult> setCustomModeline(String modeline)
	Promise<ScreenConfigList> getScreenModes();
    Promise<SetModeResult> setScreenModes(ScreenConfigList configs);
};

interface Mode {
    attribute String modeName;
    attribute String colorSpace;
    attribute String colorDepth;
    attribute int frequency;
    attribute bool dropFrame;
    attribute int width;
    attribute int height;
    attribute int graphicsPlaneHeight;
    attribute int graphicsPlaneWidth;
    attribute bool preferred;
    attribute bool interlaced;
    attribute int overscan;
};

interface SetModeResult {
    attribute bool restartRequired;
};

interface ScreenConfig {
    attribute String outputName;
    attribute String videoMode;
    attribute int screenX;
    attribute int screenY;
    attribute String transform;
    attribute bool enabled;
};
```

## Object Creation

To create *vidoemodeconfiguration* object, first load the `brightsign/videomodeconfiguration` module using the `require()` method. Then create an instance of the *videomodeconfiguration* class.

```javascript
var VideoModeConfigurationClass = require("@brightsign/videomodeconfiguration");
var videoConfig = new VideoModeConfigurationClass();
```

## VideoModeConfiguration

Use this interface to retrieve and modify the video-mode settings.

**getAvailableModes()**

```javascript
Promise<ModeList> getAvailableModes() 
```

Returns a list containing all video modes supported by the player. Each supported video mode is listed as a `Mode` instance.

**getBestMode()**

```javascript
Promise<Mode> getBestMode(String connector)
```

Returns the largest supported [video mode](docId\:QpML112mBhEK7LBDGUxnv), as reported by the display via EDID. The video connector can be specified as "hdmi" or "vga" (these values are case sensitive). If the display does not return a resolution value over EDID, this method returns a blank string. If no display is connected, this method returns "Cannot read edid information".

**getActiveMode()**

```javascript
Promise<Mode> getActiveMode() 
```

Returns a `Mode` interface containing information about the current active video mode.

**getConfiguredMode()**

```javascript
Promise<Mode> getConfiguredMode() 
```

Returns a `Mode` interface containing information about the video mode that has been configured with the `setMode()` method. If the video mode has not been configured with `setMode()` (or if it has been set to "auto"), this method will return null.

**setMode()**

```javascript
Promise<SetModeResult> setMode(Mode mode)
```

Sets the video output mode using a passed `Mode` interface. This method returns a promise containing a `SetModeResult` interface that indicates whether a reboot is required for the specified video settings to take effect.&#x20;

**setCustomModeline()**

```javascript
Promise<SetModeResult> setCustomModeline(String modeline)
```

Sets the custom videomode with the supplied modeline (see [Apply a Custom Resolution](docId:58VplQM4sGH_VgqVs4Frs)). The custom videomode can then be selected using setMode.

**getScreenModes()&#xA0;**

```javascript
Promise<ScreenConfigList> getScreenModes()
```

Returns an array which describes each available output on your player hardware and how those outputs are configured. This method has been implemented as of BOS 9.0.15.

The ScreenConfig interface contains the returned settings from getScreenModes():

- `outputName` <font color="#6554c0">string</font>: HDMI-1, 2, 3, or 4 
- `videoMode` <font color="#6554c0">string</font>: The videomode can be either:
  - A known BrightSign format videomode (for example, *1920x1080x60p)*
  - A full modeline as described on [this page](docId:58VplQM4sGH_VgqVs4Frs)&#x20;
- *auto&#xA0;*&#x77;hich differs slightly from previous platforms. *auto* isn’t recommended when using multiple outputs because the canvas positions are fixed and so if a screen uses an unexpected resolution, it won’t be positioned correctly in the canvas.
- `screenX` <font color="#6554c0">int</font>: The position of the screen on the canvas. The origin (0,0) is the top left corner, and each screen can be positioned relative to it. This allows gaps to be left on the canvas between screens for bezel compensation.
- `screenY` <font color="#6554c0">int</font>: The position of the screen on the canvas. The origin (0,0) is the top left corner, and each screen can be positioned relative to it. This allows gaps to be left on the canvas between screens for bezel compensation.
- `transform` <font color="#6554c0">string:</font> One of normal, 90, 180 or 270 rotations. Each screen can be rotated independently and when a screen is rotated, all content including video will be rotated.&#x20;
- `enabled` <font color="#6554c0">bool</font>: Whether the screen is enabled for output

**setScreenModes()**

```javascript
Promise<SetModeResult> setScreenModes(ScreenConfigList configs)
```

Takes the same format as argument that `getScreenModes()` returns. By default a single screen is enabled. The player uses full resolution graphics if any of the videomodes configured using SetScreenModes use the `:fullres` modifier. See [this page](docId\:QQ734nQz0hCwNI0uNSdMP) to understand how the x/y display coordinates work with output resolution.

This method has been implemented as of BOS 9.0 and later.

## Mode

This interface contains the settings of a video-mode configuration.

:::hint{type="info"}
In 4K modes, the graphics plane may be smaller than the video plane and output. In these cases, the graphics plane is upscaled to match the video plane/output.
:::

- `modeName` <font color="#6554c0">string</font>: A description of the [video mode](docId:58VplQM4sGH_VgqVs4Frs) (as well as any additional [video mode parameters](docId\:QQ734nQz0hCwNI0uNSdMP)). The video mode can also be set to  ["Auto"](docId\:QQ734nQz0hCwNI0uNSdMP), “gfxmemlarge”, or "custom" which will use the mode configured using setCustomModeline.
- `colorSpace `<font color="#6554c0">string</font>: The color space of the video signal ("rgb", "yuv420", or "yuv422")
- `colorDepth` <font color="#6554c0">string</font>: The color depth of the video signal ("8bit", "10bit", or "12bit")
- `frequency` <font color="#6554c0">int</font>: The frame rate of the video output
- `dropFrame` <font color="#6554c0">bool</font>: Whether the video timecode uses drop frames 
- `width` <font color="#6554c0">int</font>: The width of the video output
- `height` <font color="#6554c0">int</font>: The height of the video output
- `graphicsPlaneHeight` <font color="#6554c0">int</font>: The width of the graphics plane 
- `graphicsPlaneWidth` <font color="#6554c0">int</font>: The height of the graphics plane
- `preferred` <font color="#6554c0">bool</font>: Whether the video mode is the *preferred* mode, which instructs the player to only use the video mode if the display EDID indicates that it is supported. Otherwise, the output will default to ["Auto" video](docId\:QQ734nQz0hCwNI0uNSdMP) mode. If no EDID is detected at bootup, the player will output the preferred video mode. If an HDM&#x49;**®** hotplug event occurs afterward, then the player will perform the preferred video-mode check again.&#x20;
  - `preferred`*&#xA0;*&#x6D;ode ignores video profile settings (i.e. color space and bit depth).
- `interlaced `<font color="#6554c0">bool</font>: Whether the video output is interlaced
- `overscan` <font color="#6554c0">int:</font> Whether the video output is using an overscan setting or not

## SetModeResult

This interface is returned by the setMode() method.

- `restartRequired` <font color="#6554c0">bool</font>: A flag indicating whether or not a reboot is required for the change in video settings to take effect.

## ScreenConfig

- `outputName` <font color="#6554c0">string</font>
- `videoMode` <font color="#6554c0">string</font>
- `screenX` <font color="#6554c0">int</font>
- `screenY` <font color="#6554c0">int</font>
- `transform` <font color="#6554c0">string</font>
- `enabled`  <font color="#6554c0">bool</font>

## Example

This script retrieves the largest supported video mode (as reported by the display EDID over HDMI) and sets the video output to this mode. It then reboots the player if required.

```javascript
var VideoModeConfigurationClass = require("@brightsign/videomodeconfiguration");
var videoConfig = new VideoModeConfigurationClass();
var SystemClass = require("@brightsign/system");
var system = new SystemClass();

var bestRes = "";

videoConfig.getBestMode("hdmi").then(
        function(data) {
            bestRes = data;
        })
    .catch(
        function(data) {
            console.log(JSON.stringify(data));
        });

var configData = {};
configData.modeName = bestRes;

videoConfig.setMode(configData).then(
        function(data) {
            if (data.restartRequired === true) {
                system.reboot();
            } else {
                console.log("Reboot not required.")
            }
        })
    .catch(
        function(data) {
            console.log(JSON.stringify(data));
        });
```

