Player APIs (BrightScript & Ja...
JavaScript APIs
videooutput
23min
the videooutput object allows you to configure and retrieve non persistent settings related to a video output (the video mode itself is configured with the videomodeconfiguration docid\ uupzxkyflbsolyh8olces object) videooutput idl interface videooutputevent { attribute string type; }; callback videooutputeventcallback = void (videooutputevent event); \[ constructor(string interfacename) ] interface videooutputconfiguration { attribute string type; promise\<size> getvideoresolution(); promise\<size> getgraphicsresolution(); promise\<size> getoutputresolution(); promise\<void> adjustgraphicscolor(colorproperties); promise\<edididentity> getedididentity(); promise\<string> getedid(); promise\<void> setmultiscreenbezel(int xpercentage, int ypercentage); promise\<void> setbackgroundcolor(int color); promise\<void> setpowersavemode(bool enable); promise\<bool> getpowersavemode(); promise\<void> set3dmode(int mode); promise\<bool> isattached(); \[type == "hdmi"] promise\<outputstatus> getoutputstatus(); \[type == "hdmi"] promise\<void> disableaudio(bool disable); \[type == "hdmi"] promise\<txhdcpstatus> gettxhdcpstatus(); \[type == "hdmi"] promise\<void> forcehdcpon(bool); promise\<void> setsyncdomain(string domain) promise\<void> setmpcdi(string filename); void addeventlistener(string type, videooutputeventcallback callback); void removeeventlistener(string type, videooutputeventcallback callback); }; interface edididentity { attribute string manufacturer; attribute int product; attribute int serialnumber; attribute int weekofmanufacture; attribute int yearofmanufacture; attribute string monitorname; attribute string textstring; attribute string serialnumberstring; attribute bool bt2020rgbsupport; attribute bool bt2020yccsupport; attribute bool sdreotfsupport; attribute bool hdreotfsupport; attribute bool hdrst2084support; }; interface outputstatus { attribute bool outputpresent; attribute bool outputpowered; attribute bool unstable; attribute string audioformat; attribute int audiosamplerate; attribute int audiobitspersample; attribute int audiochannelcount; attribute string eotf; }; interface size { attribute int width; attribute int height; }; interface colorproperties { attribute int constrast; attribute int saturation; attribute int hue; attribute int brightness; }; object creation to create a videooutput object, first load the brightsign/videooutput module using the require() method then create an instance of the videooutput class with a string value specifying the video output to configure (currently accepted values are " hdmi 1 ", " hdmi 2 ", " hdmi 3 ", " hdmi 4 " and " vga ") var videooutputclass = require("@brightsign/videooutput"); var videooutputhdmi = new videooutputclass("hdmi 1"); videooutputconfiguration use this interface to perform operations on the video output events a videooutputevent is raised when the hotplug status of the hdmi ® output changes it has one type property type the event type is hotplugevent methods getvideoresolution() promise\<size> getvideoresolution() returns the current resolution of the video plane getgraphicsresolution() promise\<size> getgraphicsresolution() returns the current resolution of the graphics plane getoutputresolution() promise\<size> getoutputresolution() returns the current video output resolution in most cases, the values returned by the getvideoresolution(), getgraphicsresolution(), and getoutputresolution () methods will be identical the "graphicsresolution" and "videoresolution" values will differ when a 4k video mode is selected and full resolution graphics is not enabled the graphics plane remains at hd (1920x1080), while the video plane expands to 4k (e g to 3840x2160) the "outputresolution" value will differ from the other two values when the video output is upscaled for example, when upscaling from hd to 4k, the "graphicsresolution" and "videoresolution" values will remain at 1920x1080, while the "outputresolution" values will indicate 3840x2160 adjustgraphicscolor() promise<> adjustgraphicscolor(colorproperties) adjusts the video and graphics output of the player using the options in the passed colorproperties instance getedididentity() promise\<edididentity> getedididentity() returns edid information from a compatible monitor/television as an edididentity interface getedid() promise\<string> getedid() returns edid information from a compatible monitor/television as a hex encoded string setmultiscreenbezel() promise<> setmultiscreenbezel(int xpercentage, int ypercentage) adjusts the size of the bezel used in calculations for multiscreen displays, allowing for users to compensate for the width of their screen bezels the calculations for the percentages are as follows xpercentage = (width of bezel between active screens / width of active screen) 100 ypercentage = (height of bezel between active screens / height of active screen) 100 the bezel measurement is therefore the total of the top and bottom bezels in the y case, or the left and right bezels in the x case when this value is set correctly, images spread across multiple screens take account of the bezel widths, leading to better alignment of images setbackgroundcolor() promise<> setbackgroundcolor(int color) specifies the background color using an #rrggbb hex value (8 bits for each color) setpowersavemode() promise<> setpowersavemode(bool enable) disables hdmi output and the syncs for vga output if passed true the absence of a signal will cause some monitors to go into standby mode getpowersavemode() promise\<bool> getpowersavemode() returns true if power save mode is enabled on the video output set3dmode() promise<> set3dmode(int mode) sets the 3d video output mode, which is specified by passing one the following parameters 0 standard mono video (default) 1 side by side stereo video 2 top and bottom stereo video isattached() promise\<bool> isattached() returns true if the hdmi/vga video connector is attached to an output device (i e the display edid can be read successfully) this method will always return false if setpowersavemode(true) has been called on the output getoutputstatus() \[type == "hdmi"] promise\<outputstatus> getoutputstatus() returns outputstatus which describes the current state of the video output and is defined below disableaudio() \[type == "hdmi"] promise\<void> disableaudio(bool disable) disables audio output if passed true , the video will continue to output gettxhdcpstatus() \[type == "hdmi"] promise\<txhdcpstatus> gettxhdcpstatus() returns the current hdcp authentication state of the video output forcehdcpon() \[type == "hdmi"] promise\<void> forcehdcpon(bool) can be used to force hdcp authentication on the video output even without hdcp forced on, there can still be hdcp on the output if an hdmi input has requested authentication setsyncdomain() promise\<void> setsyncdomain(string domain) passing any string will enable genlock synchronization to disable genlock on the domain, pass an empty string to this method genlock synchronization will lock the vertical sync of the video output to the system clock reference ptp is then used to synchronize the system clock of multiple players (for example, in a video wall) setmpcdi() promise\<void> setmpcdi(string filename) users that construct an mpcdi file as per the version1a 2d media profile should pass videooutputhdmi setmpcdi("sd /filename mpcdi") to the player to decode the file and apply the warp and blend to the output as per the requirements set in filename mpcdi (replace "filename" with the name of your actual file) passing an empty string will turn off the warp and blend, and the image will return to the normal format series 4 players implement all levels of the mpcdi 2d media profile (version 1a) close() 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 edididentity this interface contains edid information about an attached display manufacturer string string product int int serialnumber int int weekofmanufacture int int yearofmanufacture int int monitorname string string textstring string string serialnumberstring string string bt2020rgbsupport bool bool bt2020yccsupport bool bool sdreotfsupport bool bool hdreotfsupport bool bool hdrst2084support bool bool outputstatus this interface contains information about an attached hdmi display device the outputpresent and outputpowered entries will always be false if setpowersavemode(true) has been called on the output outputpresent bool bool a flag indicating whether the hdmi output is connected to a display device or not outputpowered bool bool a flag indicating whether the display device is on (i e rx powered) unstable bool bool a flag indicating whether the display signal is unstable or stable audioformat string string the format of the audio output a "pcm" value indicates that the player is sending decoded output audiosamplerate int int the audio sample rate (in hertz) audiobitspersample int int the number of bits per audio sample audiochannelcount int int the number of audio channels in the output eotf string string the current electro optical transfer function (eotf) used by the display the following are possible values "hdr (gamma)" "sdr (gamma)" "smpte 2084 (pq)" "future (bbc/nhk)" "unspecified" size this interface represents a video resolution width int int the height of the screen/plane height int int the width of the screen/plane colorproperties this interface is passed to the adjustgraphicscolor() method each of the following parameters has a default value of 0 and can accept a range of values between 1000 and 1000 contrast int int saturation int int hue int int brightness int int txhdcpstatus this interface is returned by the gettxhdcpstatus() method state string string the hdcp status of the hdmi output, which can be one of the following values " not required " hdcp is not required by the player hdcp is required by the player if the video has been decoded locally and needs protection or if the script has called the forcehdcpon() method note that, even if this parameter indicates not required , hdcp might still be active in passthrough mode if an upstream hdmi source (i e a device connected to the hdmi input port on the player) has requested it " authenticated " hdcp has been enabled and successfully negotiated " authentication in progress " hdcp has been enabled but authentication is incomplete " authentication failed " hdcp has been requested but could not be negotiated example var videooutputclass = require("@brightsign/videooutput"); var videooutputhdmi = new videooutputclass("hdmi"); videooutputhdmi getoutputstatus() then( function(data) { console log("\nprint the hdmi output status"); console log(json stringify(data)); }) catch( function(data) { console log(json stringify(data)); })