display
The sos.display
API groups together methods for getting information about the device. Primarily to find out which
features it supports.
Methods
supports()
The supports()
method determines whether the device supports a queried capability.
What are capabilities?
Capabilities are features or functionalities that a device can support. We divided those capabilities into front
and management
capabilities.
This section is about front capabilities, which include features like handling serial ports, video and stream playback, and more.
On the other hand, the management
capabilities are features that are related to the application management, such as app upgrade, app version, and more.
To check management
capabilities, refer to the sos.management.supports()
method or this section.
If you want to check specific capabilities, refer to the sidebar for the selected management section. Every section has its capabilities written in the description,
or check the DisplayCapability type in supports()
methods. It has a list of all available capabilities for all platforms.
supports(capability: DisplayCapability): Promise<boolean>;
Params
Name | Type | Required | Description |
---|---|---|---|
capability | DisplayCapability | Yes | The capability to check for support. |
Return value
Resolves to true
if the capability is supported, otherwise false
.
API Example
import { sos } from '@signageos/front-applet';
void sos.onReady(async () => {
const supports = await sos.display.supports('SERIAL');
if (supports) {
console.log('This device supports serial port.');
} else {
console.log('This device does NOT support serial port.');
}
});