sos
Learn more about using this API here
The sos
API groups together all functionality the @signageos/front-applet offers.
Properties
appletVersion
The appletVersion
is the version of the current applet.
readonly appletVersion: string;
authHash
Learn more about using this API here
The authHash
property is an alternative device identifier, which is designed for secure pairing and locating devices through
the REST API.
- The
authHash
is commonly used as a link between the Applet deployed on the device and the device in device management. - The
authHash
is unique and can be revoked upon request. - The
authHash
can be used as a universal identifier for your Applet application.
readonly authHash: string;
config
Learn more about using this API here
The config
property is a Key-value dictionary of the applet configuration.
readonly config: Record<string, number | string | boolean>;
Methods
onReady()
The onReady()
method accepts an optional listener which is called after the sos API are loaded and ready. It also returns a promise
which is resolved at the same time as the listener.
onReady(listener?: () => void): Promise<void>;
Example
sos.onReady().then(async function () {
console.log(await sos.app.getType());
});
sos.onReady(async function () {
console.log(await sos.app.getType());
});
refresh()
The refresh()
method initializes refresh of the applet. Similar to window.location.reload(), but the applet is not downloaded again.
refresh(): Promise<void>;
Example
await sos.refresh();
restore()
The restore()
method clears all previously played videos, streams, clear display view. The typical case of usage for digital signage
is playing a loop with some specified duration. This method should be called always when the loop is changed. It will clear all
previously played videos, streams, clear display views, and notify for garbage collection.
It stops all video playback and clears out the memory. The following function should be triggered only in a case the whole playback needs to be restarted as it's completely switching the playback 'loop/playlist'.
restore(): void;
Example
sos.restore();