---
title: videoinput
slug: develop/videoinput
docTags: 
createdAt: 2025-03-27T16:58:56.102Z
---

The *videoinput&#xA0;*&#x6F;bject allows you to retrieve information about the HDM&#x49;*®* input and configure EDID settings for it.

**videoinput IDL**

```javascript
callback VideoInputEventCallback = void (VideoInputEvent event);
 
interface VideoInputConfiguration {
    VideoInputConfig defaultConfig();
    Promise<VideoInputConfig> getConfig();
    Promise<Status> applyConfig(VideoInputConfig config);
    Promise<HdmiInputStatus> getStatus();
    void addEventListener(String type, VideoOutputEventCallback callback);
    void removeEventListener(String type, VideoOutputEventCallback callback);
};
 
interface VideoInputConfig {
    attribute bool enableAc3;
    attribute bool enableEac3;
    attribute bool enableTrueHdMlp;
    attribute bool enableDts;
    attribute bool enableDtsHd;
    attribute int maxSampleRate;
    attribute int maxChannelCount;
    attribute String lockAudioTo;
    attribute bool disableHdcpRepeater;
    attribute bool disableYuvColor;
};
 
interface Status {
    attribute bool rebootRequired;
};
 
interface HdmiInputStatus {
    attribute bool devicePresent;
    attribute int  width;
    attribute int  height;
    attribute bool interlaced;
    attribute float frameRate;
    attribute float pixelClock;
    attribute String colorSpace;
    attribute String audioType;
    attribute int audioSamplingRate;
};
```

## Object Creation

To create a *videoinput* object, first load the `brightsign/videoinputmodule` using the `require()` method. Then create an instance of the *videoinput* class.

```javascript
var VideoInputClass = require("@brightsign/videoinput");
var vi = new VideoInputClass();
```

## VideoInputConfiguration

Use this interface to retrieve and modify video input data.

### Events

A `VideoInputEvent` is raised when the hotplug status of the HDM&#x49;*®* input changes. It has one type property:

- `type`: The event type is `hdmiinputchange`

### Methods

**defaultConfig()**

```javascript
VideoInputConfig defaultConfig() 
```

Immediately returns a VideoInputConfig interface containing default EDID-reporting values for the HDMI input.

**getConfig()**

```javascript
Promise <VideoInputConfig> getConfig() 
```

Returns a VideoInputConfig interface containing the current EDID-reporting configuration for the HDMI input.

**applyConfig()**

```javascript
Promise <Status> applyConfig(VideoInputConfig config) 
```

Configures EDID reporting for the HDMI input. By default, the input EDID includes video modes from the display attached to the HDMI output, some video modes supported by the player, and support for PCM audio up to 48kHz; it does not report proprietary media codecs that can be decoded by the device connected to the HDMI output, so you can use this method to announce such support if available at the endpoint. This method returns a promise containing a Status interface that indicates whether a reboot is required for the specified EDID-reporting settings to take effect.

**getStatus()**

```javascript
Promise <HdmiInputStatus> getStatus() 
```

Returns the current status of the HDMI input.

**close()**

```javascript
Promise <void> close() 
```

This method shuts down the instance, preventing it from further consuming resources. If it is not called, garbage collection determines when the instance will be destroyed.

## VideoInputConfig

This interface contains configuration data related to the video input.

- `enableAc3` <font color="#6554c0">bool</font>: A flag specifying whether AC-3 is supported
- `enableEac3` <font color="#6554c0">bool</font>: A flag specifying whether E-AC-3 is supported
- `enableTrueHdMlp` <font color="#6554c0">bool</font>: A flag specifying whether TrueHD MLP is supported
- `enableDts` <font color="#6554c0">bool</font>: A flag specifying whether DTS is supported
- `enableDtsHd` <font color="#6554c0">bool</font>: A flag specifying whether DTS-HD is supported
- `maxSampleRate` <font color="#6554c0">int</font>: The maximum supported PCM audio sampling rate in Hz (e.g. the default sampling rate is 48000)
- `maxChannelCount` <font color="#6554c0">int</font>: The number of PCM channels that are advertised over EDID. The default value is 2, which allows for stereo mixdown. Increasing this value to 6 allows the source to send multichannel PCM. If AC-3 or E-AC-3 is enabled on the player, multichannel audio is supported regardless of the m `axChannelCount`  setting. 
- `maxHdcpVersion` <font color="#6554c0">int</font>: The maximum supported version of HDCP advertised by the HDMI input. The default value is 2, which indicates support for HDCP 2.2. It can also be set to 1, which limits advertised support to HDCP 1.4.
- `lockAudioTo` <font color="#6554c0">string</font>: Whether the audio sample rate clock is locked to the video clock ("`video`") or audio clock ("`audio`") of the incoming HDMI signal. The determination can also be left to the system software ("`auto`").
- `disableHdcpRepeater` <font color="#6554c0">bool</font>:  Disables the HDCP repeater functionality. If set to `true`, the source device attached to the HDMI input will see the device as not being HDCP capable and will downgrade the video it sends, or not send it at all.
- `disableYuvColor` <font color="#6554c0">bool</font>: Alters the EDID that the player sends to devices attached to the HDMI input. If set to `true`, it will advertise that it only supports RGB video modes and not YUV modes.

## Status

This interface is returned by the `applyConfig()` method.

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

## HDMIInputStatus

This interface contains information about the video source connected to the HDMI input: 

- `devicePresent` <font color="#6554c0">bool</font>: Whether an HDMI input source is present (`true`) or not (`false`)
- `width` <font color="#6554c0">int</font>: The width of the source video
- `height` <font color="#6554c0">int</font>: The height of the source video
- `interlaced` <font color="#6554c0">bool</font>: A flag indicating whether the video source is interlaced
- `frameRate` <font color="#6554c0">float</font>: The framerate of the source video
- `pixelClock` <font color="#6554c0">float</font>: The pixel-clock rate of the source video (in MHz)
- `colorSpace` <font color="#6554c0">string</font>:  The color space of the source video, which can be one of the following: "`RGB`", "`YCbCr420`", "`YCbCr422`", "`YCbCr444`"
- `audioType` <font color="#6554c0">string</font>: The audio encoding of the source video, which can be either "`PCM`" or "`Compressed`"
- `audioSamplingRate` <font color="#6554c0">int</font>: The audio sampling rate of the source video (in Hz)

## Example

```javascript
var VideoInputClass = require("@brightsign/videoinput");
var vi = new VideoInputClass();


var inputConfig = {};
inputConfig.enableAc3 = true;

vi.applyConfig(inputConfig).then(
        function(data) {
            if (data.rebootRequired === true) {
                system.reboot();
            } else {
                console.log("Reboot not required.")
            }
        })
    .catch(
        function(data) {
            console.log(JSON.stringify(data));
        });

vi.getConfig().then(
        function(data) {
            console.log("***Current Config***");
            console.log(JSON.stringify(data));
        })
    .catch(
        function(data) {
            console.log(JSON.stringify(data));
        });


```

