@signageos/front-applet 8.0.1 → 8.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.js.map +1 -1
- package/docs/fpath/index.md +22 -1
- package/docs/sos/browser.md +31 -1
- package/docs/sos/command.md +25 -1
- package/docs/sos/debug.md +21 -0
- package/docs/sos/deviceInfo.md +30 -0
- package/docs/sos/display.md +21 -0
- package/docs/sos/fileSystem.md +55 -1
- package/docs/sos/hardware/barcodeScanner.md +4 -0
- package/docs/sos/hardware/index.md +44 -1
- package/docs/sos/hardware/led.md +15 -0
- package/docs/sos/index.md +30 -2
- package/docs/sos/input.md +17 -0
- package/docs/sos/monitors.md +20 -1
- package/docs/sos/native/index.md +4 -0
- package/docs/sos/native/mdc.md +4 -0
- package/docs/sos/offline/cache.md +24 -0
- package/docs/sos/offline/index.md +8 -0
- package/docs/sos/osd.md +19 -0
- package/docs/sos/proofOfPlay.md +18 -9
- package/docs/sos/stream.md +4 -0
- package/docs/sos/sync.md +7 -3
- package/docs/sos/video.md +8 -0
- package/docs/sos_management/app.md +4 -0
- package/docs/sos_management/audio.md +18 -1
- package/docs/sos_management/debug.md +4 -0
- package/docs/sos_management/firmware.md +30 -0
- package/docs/sos_management/index.md +5 -1
- package/docs/sos_management/network.md +7 -3
- package/docs/sos_management/os.md +4 -0
- package/docs/sos_management/package.md +11 -7
- package/docs/sos_management/power.md +53 -1
- package/docs/sos_management/proxy.md +29 -0
- package/docs/sos_management/remoteControl.md +40 -0
- package/docs/sos_management/screen.md +4 -0
- package/docs/sos_management/security.md +4 -0
- package/docs/sos_management/time.md +49 -5
- package/docs/sos_management/wifi.md +4 -0
- package/es6/FrontApplet/FileSystem/FileSystem.d.ts +2 -0
- package/es6/FrontApplet/FileSystem/FileSystem.js +2 -0
- package/es6/FrontApplet/FileSystem/FileSystem.js.map +1 -1
- package/es6/FrontApplet/FrontApplet.d.ts +12 -2
- package/es6/FrontApplet/FrontApplet.js +12 -2
- package/es6/FrontApplet/FrontApplet.js.map +1 -1
- package/es6/FrontApplet/Hardware/Hardware.d.ts +2 -0
- package/es6/FrontApplet/Hardware/Hardware.js +2 -0
- package/es6/FrontApplet/Hardware/Hardware.js.map +1 -1
- package/es6/FrontApplet/Management/Firmware/Firmware.d.ts +14 -0
- package/es6/FrontApplet/Management/Firmware/Firmware.js +8 -0
- package/es6/FrontApplet/Management/Firmware/Firmware.js.map +1 -1
- package/es6/FrontApplet/Management/Package/Package.d.ts +0 -8
- package/es6/FrontApplet/Management/Package/Package.js +0 -8
- package/es6/FrontApplet/Management/Package/Package.js.map +1 -1
- package/es6/FrontApplet/Management/Power/Power.d.ts +24 -0
- package/es6/FrontApplet/Management/Power/Power.js +25 -1
- package/es6/FrontApplet/Management/Power/Power.js.map +1 -1
- package/es6/FrontApplet/Management/Proxy/Proxy.d.ts +13 -0
- package/es6/FrontApplet/Management/Proxy/Proxy.js +13 -0
- package/es6/FrontApplet/Management/Proxy/Proxy.js.map +1 -1
- package/es6/FrontApplet/Management/RemoteControl/RemoteControl.d.ts +18 -0
- package/es6/FrontApplet/Management/RemoteControl/RemoteControl.js +18 -0
- package/es6/FrontApplet/Management/RemoteControl/RemoteControl.js.map +1 -1
- package/es6/FrontApplet/Management/Time/Time.d.ts +15 -3
- package/es6/FrontApplet/Management/Time/Time.js +9 -0
- package/es6/FrontApplet/Management/Time/Time.js.map +1 -1
- package/es6/FrontApplet/Monitors/Monitors.d.ts +1 -1
- package/es6/FrontApplet/Monitors/Monitors.js +1 -1
- package/es6/FrontApplet/Offline/Cache/Cache.d.ts +6 -0
- package/es6/FrontApplet/Offline/Cache/Cache.js +6 -0
- package/es6/FrontApplet/Offline/Cache/Cache.js.map +1 -1
- package/es6/FrontApplet/Offline/Offline.d.ts +2 -0
- package/es6/FrontApplet/Offline/Offline.js +2 -0
- package/es6/FrontApplet/Offline/Offline.js.map +1 -1
- package/es6/FrontApplet/ProofOfPlay/ProofOfPlay.d.ts +0 -10
- package/es6/FrontApplet/ProofOfPlay/ProofOfPlay.js +0 -10
- package/es6/FrontApplet/ProofOfPlay/ProofOfPlay.js.map +1 -1
- package/es6/FrontApplet/Video/Video.d.ts +2 -0
- package/es6/FrontApplet/Video/Video.js +2 -0
- package/es6/FrontApplet/Video/Video.js.map +1 -1
- package/es6/fpath.d.ts +19 -1
- package/es6/fpath.js +19 -1
- package/es6/fpath.js.map +1 -1
- package/package.json +1 -1
package/docs/fpath/index.md
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 99
|
|
3
|
+
---
|
|
4
|
+
|
|
1
5
|
# fpath
|
|
2
6
|
|
|
3
|
-
fpath utility mirrors node path
|
|
7
|
+
fpath utility mirrors node [path](https://nodejs.org/docs/latest/api/path.html)
|
|
8
|
+
module, but accepts IFilePath type instead of strings. It is useful when
|
|
9
|
+
working with [sos.fileSystem](/sdk/sos/fileSystem).
|
|
4
10
|
|
|
5
11
|
Not implemented functions:
|
|
6
12
|
- format
|
|
@@ -8,6 +14,21 @@ Not implemented functions:
|
|
|
8
14
|
- parse
|
|
9
15
|
- relative
|
|
10
16
|
|
|
17
|
+
```ts
|
|
18
|
+
import { sos, fpath } from "@signageos/front-applet";
|
|
19
|
+
|
|
20
|
+
const [internal] = await sos.fileSystem.listInternalStorageUnits();
|
|
21
|
+
const rootPath = {
|
|
22
|
+
filePath: '', // Empty string is used as an absolute path instead of "/"
|
|
23
|
+
storageUnit: internal
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
// list saved files in videos/2025-05-19/ directory
|
|
27
|
+
const videos = await sos.fileSystem.listFiles(
|
|
28
|
+
fpath.join(rootPath, "videos", "2025-05-19"),
|
|
29
|
+
);
|
|
30
|
+
```
|
|
31
|
+
|
|
11
32
|
## Properties
|
|
12
33
|
|
|
13
34
|
### path
|
package/docs/sos/browser.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 0
|
|
3
|
+
---
|
|
4
|
+
|
|
1
5
|
# browser
|
|
2
6
|
|
|
3
7
|
The `sos.browser` API groups together methods for working with the integrated web browser.
|
|
@@ -157,7 +161,7 @@ sos.browser.open('https://www.signageos.io', {
|
|
|
157
161
|
|
|
158
162
|
### ~openLink()~
|
|
159
163
|
|
|
160
|
-
:::danger
|
|
164
|
+
:::danger Deprecated
|
|
161
165
|
|
|
162
166
|
This method was deprecated. use `sos.browser.open()` instead
|
|
163
167
|
|
|
@@ -207,4 +211,30 @@ type ITheme = {
|
|
|
207
211
|
};
|
|
208
212
|
};
|
|
209
213
|
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
## API Example
|
|
217
|
+
|
|
218
|
+
```ts
|
|
219
|
+
import { sos } from '@signageos/front-applet';
|
|
220
|
+
|
|
221
|
+
void sos.onReady(async () => {
|
|
222
|
+
await sos.browser.open('https://www.signageos.io', {
|
|
223
|
+
aclDomains: ['google.com', 'yahoo.com'],
|
|
224
|
+
aclMode: 'blacklist', // or 'whitelist'
|
|
225
|
+
readOnlyAddressBar: true,
|
|
226
|
+
coordinates: {
|
|
227
|
+
// Supported only on Linux and Android
|
|
228
|
+
x: 0,
|
|
229
|
+
y: 0,
|
|
230
|
+
height: 500,
|
|
231
|
+
width: 500,
|
|
232
|
+
},
|
|
233
|
+
// theme: { ... } // supported only on Android
|
|
234
|
+
headlessMode: false, // supported only on Android
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
await sos.browser.close(); // Close the browser
|
|
238
|
+
});
|
|
239
|
+
|
|
210
240
|
```
|
package/docs/sos/command.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 0
|
|
3
|
+
---
|
|
4
|
+
|
|
1
5
|
# command
|
|
2
6
|
|
|
3
7
|
The `sos.command` API groups together methods for sending logs and receiving commands from signageOS.
|
|
@@ -65,4 +69,24 @@ interface ICommand {
|
|
|
65
69
|
|
|
66
70
|
- [Receiving commands](https://github.com/signageos/applet-examples/blob/master/examples/content-js-api/command/receiving)
|
|
67
71
|
|
|
68
|
-
:::
|
|
72
|
+
:::
|
|
73
|
+
|
|
74
|
+
## API Example
|
|
75
|
+
|
|
76
|
+
```ts
|
|
77
|
+
import { sos } from '@signageos/front-applet';
|
|
78
|
+
|
|
79
|
+
void sos.onReady(async () => {
|
|
80
|
+
/* Example of dispatching information about file download */
|
|
81
|
+
await sos.command.dispatch({
|
|
82
|
+
type: 'Files.StartLoading', // mandatory *type* with custom value
|
|
83
|
+
fileName: 'my-file', // custom parameter and value
|
|
84
|
+
fileType: 'txt', // custom parameter and value
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
sos.command.onCommand((command) => {
|
|
88
|
+
console.log(`new command ${command.type} received, with data:`, command.command);
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
```
|
package/docs/sos/debug.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 0
|
|
3
|
+
---
|
|
4
|
+
|
|
1
5
|
# debug
|
|
2
6
|
|
|
3
7
|
The `sos.debug` API groups together methods for checking the state of remote debug mode.
|
|
@@ -22,4 +26,21 @@ The `onRemoteDebugChanged()` method sets up a listener, which is called whenever
|
|
|
22
26
|
onRemoteDebugChanged(listener: (data: {
|
|
23
27
|
enabled: boolean;
|
|
24
28
|
}) => void): void;
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## API Example
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
import { sos } from '@signageos/front-applet';
|
|
35
|
+
|
|
36
|
+
void sos.onReady(async () => {
|
|
37
|
+
if (await sos.debug.isRemoteDebugEnabled()) {
|
|
38
|
+
console.log('Remote debug is turned on');
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
sos.debug.onRemoteDebugChanged((enabled) => {
|
|
42
|
+
console.log('Weinre debug is', { enabled });
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
|
|
25
46
|
```
|
package/docs/sos/deviceInfo.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 0
|
|
3
|
+
---
|
|
4
|
+
|
|
1
5
|
# deviceInfo
|
|
2
6
|
|
|
3
7
|
The `sos.deviceInfo` API groups together methods for retrieving information about the device set in the CloudControl, such as location or
|
|
@@ -46,4 +50,30 @@ interface IOrganizationTag {
|
|
|
46
50
|
name: string;
|
|
47
51
|
}
|
|
48
52
|
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## API Example
|
|
56
|
+
|
|
57
|
+
```ts
|
|
58
|
+
import { sos } from '@signageos/front-applet';
|
|
59
|
+
|
|
60
|
+
void sos.onReady(async () => {
|
|
61
|
+
await printLocation();
|
|
62
|
+
await printTags();
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
const printLocation = async () => {
|
|
66
|
+
const { name, customId, description } = (await sos.deviceInfo.getLocation()) ?? {};
|
|
67
|
+
|
|
68
|
+
console.log('Location: ', { name, customId, description });
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const printTags = async () => {
|
|
72
|
+
const tags = await sos.deviceInfo.getOrganizationTags();
|
|
73
|
+
|
|
74
|
+
for (const { name } of tags) {
|
|
75
|
+
console.log('Tag: ', name);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
|
|
49
79
|
```
|
package/docs/sos/display.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 0
|
|
3
|
+
---
|
|
4
|
+
|
|
1
5
|
# display
|
|
2
6
|
|
|
3
7
|
The `sos.display` API groups together methods for getting information about the device. Primarily to find out which
|
|
@@ -18,4 +22,21 @@ type DisplayCapability = 'FILE_SYSTEM_INTERNAL_STORAGE' | 'FILE_SYSTEM_EXTERNAL_
|
|
|
18
22
|
|
|
19
23
|
type AnyString = string & {};
|
|
20
24
|
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## API Example
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
import { sos } from '@signageos/front-applet';
|
|
31
|
+
|
|
32
|
+
void sos.onReady(async () => {
|
|
33
|
+
const supports = await sos.display.supports('SERIAL');
|
|
34
|
+
|
|
35
|
+
if (supports) {
|
|
36
|
+
console.log('This device supports serial port.');
|
|
37
|
+
} else {
|
|
38
|
+
console.log('This device does NOT support serial port.');
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
|
|
21
42
|
```
|
package/docs/sos/fileSystem.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 0
|
|
3
|
+
---
|
|
4
|
+
|
|
1
5
|
# fileSystem
|
|
2
6
|
|
|
7
|
+
<Admonition type="info" icon="" title="">
|
|
8
|
+
Learn more about using this API [here](https://developers.signageos.io/docs/applets/api-guides/offline-content#storing-files-permanently)
|
|
9
|
+
</Admonition>
|
|
10
|
+
|
|
3
11
|
The `sos.fileSystem` API groups together methods for low-level access to the file system. The File System API supports both internal and
|
|
4
12
|
external storage.
|
|
5
13
|
|
|
@@ -591,4 +599,50 @@ interface IStorageUnit {
|
|
|
591
599
|
|
|
592
600
|
#### Possible errors
|
|
593
601
|
|
|
594
|
-
The method throws an error if the parent directory does not exist or the `filePath` is a directory.
|
|
602
|
+
The method throws an error if the parent directory does not exist or the `filePath` is a directory.
|
|
603
|
+
|
|
604
|
+
## API Example
|
|
605
|
+
|
|
606
|
+
```ts
|
|
607
|
+
import { sos, fpath } from '@signageos/front-applet';
|
|
608
|
+
import { IFilePath } from '@signageos/front-applet/es6/FrontApplet/FileSystem/types';
|
|
609
|
+
|
|
610
|
+
void sos.onReady(async () => {
|
|
611
|
+
const [internal] = await sos.fileSystem.listInternalStorageUnits();
|
|
612
|
+
|
|
613
|
+
const root: IFilePath = {
|
|
614
|
+
storageUnit: internal,
|
|
615
|
+
filePath: '', // empty string points to root directory
|
|
616
|
+
};
|
|
617
|
+
|
|
618
|
+
// list files in the root directory
|
|
619
|
+
const contents = await sos.fileSystem.listFiles(root);
|
|
620
|
+
|
|
621
|
+
// print files from the root directory
|
|
622
|
+
for (const entries of contents) {
|
|
623
|
+
if (await sos.fileSystem.isDirectory(entries)) {
|
|
624
|
+
console.log(`${entries.filePath} (directory)`);
|
|
625
|
+
} else {
|
|
626
|
+
console.log(`${entries.filePath} (file)`);
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
// write data into a file
|
|
631
|
+
const writePath = fpath.join(root, 'value.json');
|
|
632
|
+
await sos.fileSystem.writeFile(writePath, JSON.stringify({ data: 'Lorem ipsum dolor sit amet' }));
|
|
633
|
+
|
|
634
|
+
// download a file from the internet and play it
|
|
635
|
+
const downloadPath = fpath.join(root, 'video.mp4');
|
|
636
|
+
await sos.fileSystem.downloadFile(
|
|
637
|
+
downloadPath,
|
|
638
|
+
'https://static.signageos.io/assets/test-videos-03_AME/video-test-03_15s_1920x1080_2fe7b039750a134aeac1c0a515710007.mp4',
|
|
639
|
+
);
|
|
640
|
+
const file = await sos.fileSystem.getFile(downloadPath);
|
|
641
|
+
|
|
642
|
+
if (file) {
|
|
643
|
+
await sos.video.prepare(file.filePath, 0, 0, 1920, 1080);
|
|
644
|
+
await sos.video.play(file.filePath, 0, 0, 1920, 1080);
|
|
645
|
+
}
|
|
646
|
+
});
|
|
647
|
+
|
|
648
|
+
```
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 0
|
|
3
|
+
---
|
|
4
|
+
|
|
1
5
|
# hardware
|
|
2
6
|
|
|
3
7
|
The `sos.hardware` API groups together methods for working with hardware. It allows opening serials ports, using bar scanner or controlling LEDs.
|
|
@@ -6,6 +10,10 @@ The `sos.hardware` API groups together methods for working with hardware. It all
|
|
|
6
10
|
|
|
7
11
|
### openSerialPort()
|
|
8
12
|
|
|
13
|
+
<Admonition type="info" icon="" title="">
|
|
14
|
+
Learn more about using this API [here](https://developers.signageos.io/docs/applets/api-guides/serial-port)
|
|
15
|
+
</Admonition>
|
|
16
|
+
|
|
9
17
|
The `openSerialPort()` method opens a serial port for reading/writing. After the port is opened the method returns ISerialPort interface.
|
|
10
18
|
|
|
11
19
|
```ts expandable
|
|
@@ -61,4 +69,39 @@ interface ISerialPort {
|
|
|
61
69
|
| `options.parity` *(optional)* | `Parity` | Specifies the form of error checking, whether (or what) extra bits are added to a byte. |
|
|
62
70
|
| `options.databits` *(optional)* | `number` | Specifies the number of bits in a byte. |
|
|
63
71
|
| `options.stopbits` *(optional)* | `number` | Specifies the number of bits used to signal the end of a communication packet. |
|
|
64
|
-
| `options.rtscts` *(optional)* | `boolean` | Enables or disables RTS/CTS handshaking over the serial port. Currently supported by selected models of BrightSign. |
|
|
72
|
+
| `options.rtscts` *(optional)* | `boolean` | Enables or disables RTS/CTS handshaking over the serial port. Currently supported by selected models of BrightSign. |
|
|
73
|
+
|
|
74
|
+
## API Example
|
|
75
|
+
|
|
76
|
+
```ts
|
|
77
|
+
import { sos } from '@signageos/front-applet';
|
|
78
|
+
|
|
79
|
+
void sos.onReady(async () => {
|
|
80
|
+
// Open default serial port based platform
|
|
81
|
+
const serialPort = await sos.hardware.openSerialPort({
|
|
82
|
+
baudRate: 115200,
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
await serialPort.close();
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
void sos.onReady(async () => {
|
|
89
|
+
// Open specific serial port
|
|
90
|
+
const serialPort = await sos.hardware.openSerialPort({
|
|
91
|
+
device: '/dev/ttyUSB0',
|
|
92
|
+
baudRate: 115200,
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
serialPort.onData((data) => {
|
|
96
|
+
const dataString = [...data].map((char) => String.fromCharCode(char)).join('');
|
|
97
|
+
console.log(dataString);
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
await serialPort.write('68656c6c6f'); // hexadecimal string
|
|
101
|
+
await serialPort.write([10, 20, 30, 40]); // array of numbers
|
|
102
|
+
await serialPort.write(Uint8Array.from([10, 20, 30, 40])); // Uint8Array
|
|
103
|
+
|
|
104
|
+
await serialPort.close();
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
```
|
package/docs/sos/hardware/led.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 0
|
|
3
|
+
---
|
|
4
|
+
|
|
1
5
|
# led
|
|
2
6
|
|
|
3
7
|
The `sos.hardware.led` API groups together methods for controlling LEDs of the device. **This is currently only supported by Phillips
|
|
@@ -11,4 +15,15 @@ The `setColor()` methods sets the LED color (if string is passed) or disabled (i
|
|
|
11
15
|
|
|
12
16
|
```ts expandable
|
|
13
17
|
setColor(color: string | null): Promise<void>;
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## API Example
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
import { sos } from '@signageos/front-applet';
|
|
24
|
+
|
|
25
|
+
void sos.onReady(async () => {
|
|
26
|
+
await sos.hardware.led.setColor('#00FF00'); // For GREEN light
|
|
27
|
+
});
|
|
28
|
+
|
|
14
29
|
```
|
package/docs/sos/index.md
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 0
|
|
3
|
+
---
|
|
4
|
+
|
|
1
5
|
# sos
|
|
2
6
|
|
|
3
|
-
|
|
7
|
+
<Admonition type="info" icon="" title="">
|
|
8
|
+
Learn more about using this API [here](https://developers.signageos.io/docs/applets/getting-started/#using-the-sos-sdk)
|
|
9
|
+
</Admonition>
|
|
10
|
+
|
|
11
|
+
The `sos` API groups together all functionality the \@signageos/front-applet offers.
|
|
4
12
|
|
|
5
13
|
## Properties
|
|
6
14
|
|
|
@@ -14,6 +22,10 @@ readonly appletVersion: string;
|
|
|
14
22
|
|
|
15
23
|
### authHash
|
|
16
24
|
|
|
25
|
+
<Admonition type="info" icon="" title="">
|
|
26
|
+
Learn more about using this API [here](https://developers.signageos.io/docs/applets/api-guides/device-identification)
|
|
27
|
+
</Admonition>
|
|
28
|
+
|
|
17
29
|
The `authHash` property is an alternative device identifier, which is designed for secure pairing and locating devices through
|
|
18
30
|
the REST API.
|
|
19
31
|
|
|
@@ -27,6 +39,10 @@ readonly authHash: string;
|
|
|
27
39
|
|
|
28
40
|
### config
|
|
29
41
|
|
|
42
|
+
<Admonition type="info" icon="" title="">
|
|
43
|
+
Learn more about using this API [here](https://developers.signageos.io/docs/applets/configuration/)
|
|
44
|
+
</Admonition>
|
|
45
|
+
|
|
30
46
|
The `config` property is a Key-value dictionary of the applet configuration.
|
|
31
47
|
|
|
32
48
|
```ts expandable
|
|
@@ -66,6 +82,12 @@ The `refresh()` method initializes refresh of the applet. Similar to window.loca
|
|
|
66
82
|
refresh(): Promise<void>;
|
|
67
83
|
```
|
|
68
84
|
|
|
85
|
+
#### Example
|
|
86
|
+
|
|
87
|
+
```ts
|
|
88
|
+
await sos.refresh();
|
|
89
|
+
```
|
|
90
|
+
|
|
69
91
|
<Separator />
|
|
70
92
|
|
|
71
93
|
### restore()
|
|
@@ -74,9 +96,15 @@ The `restore()` method clears all previously played videos, streams, clear displ
|
|
|
74
96
|
is playing a loop with some specified duration. This method should be called always when the loop is changed. It will clear all
|
|
75
97
|
previously played videos, streams, clear display views, and notify for garbage collection.
|
|
76
98
|
|
|
77
|
-
|
|
99
|
+
It stops all video playback and clears out the memory. The following function should be triggered only in a case the whole playback
|
|
78
100
|
needs to be restarted as it's completely switching the playback 'loop/playlist'.
|
|
79
101
|
|
|
80
102
|
```ts expandable
|
|
81
103
|
restore(): void;
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
#### Example
|
|
107
|
+
|
|
108
|
+
```ts
|
|
109
|
+
sos.restore();
|
|
82
110
|
```
|
package/docs/sos/input.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 0
|
|
3
|
+
---
|
|
4
|
+
|
|
1
5
|
# input
|
|
2
6
|
|
|
3
7
|
## Methods
|
|
@@ -70,4 +74,17 @@ The `removeEventListeners()` method removes all event listeners bind on `sos.inp
|
|
|
70
74
|
|
|
71
75
|
```ts expandable
|
|
72
76
|
removeEventListeners(): void;
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## API Example
|
|
80
|
+
|
|
81
|
+
```ts
|
|
82
|
+
import { sos } from '@signageos/front-applet';
|
|
83
|
+
|
|
84
|
+
void sos.onReady(async () => {
|
|
85
|
+
sos.input.onKeyUp((keyUpEvent) => {
|
|
86
|
+
console.log(`Pressed: ${keyUpEvent.keyCode} (${keyUpEvent.keyName})`);
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
|
|
73
90
|
```
|
package/docs/sos/monitors.md
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 0
|
|
3
|
+
---
|
|
4
|
+
|
|
1
5
|
# monitors
|
|
2
6
|
|
|
3
|
-
The `sos.
|
|
7
|
+
The `sos.monitors` API groups together methods for providing information about monitors connected to the device.
|
|
4
8
|
|
|
5
9
|
## Methods
|
|
6
10
|
|
|
@@ -18,4 +22,19 @@ interface IConnectedMonitor {
|
|
|
18
22
|
firmware?: string;
|
|
19
23
|
}
|
|
20
24
|
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## API Example
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
import { sos } from '@signageos/front-applet';
|
|
31
|
+
|
|
32
|
+
void sos.onReady(async () => {
|
|
33
|
+
const monitors = await sos.monitors.getList();
|
|
34
|
+
|
|
35
|
+
for (const { model, manufacturer, serial } of monitors) {
|
|
36
|
+
console.log('Connected monitor: ', { model, manufacturer, serial });
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
|
|
21
40
|
```
|
package/docs/sos/native/index.md
CHANGED
package/docs/sos/native/mdc.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 0
|
|
3
|
+
---
|
|
4
|
+
|
|
1
5
|
# cache
|
|
2
6
|
|
|
7
|
+
<Admonition type="info" icon="" title="">
|
|
8
|
+
Learn more about using this API [here](https://developers.signageos.io/docs/applets/api-guides/offline-content#caching-audio-visual-content-or-arbitrary-data-sosofflinecache)
|
|
9
|
+
</Admonition>
|
|
10
|
+
|
|
3
11
|
The `sos.offline` API groups together methods used to download and save arbitrary files, which can be accessed even if the device is offline.
|
|
4
12
|
|
|
5
13
|
:::warning
|
|
@@ -26,6 +34,10 @@ The method throws an error if the uid does not exist.
|
|
|
26
34
|
|
|
27
35
|
### deleteContent()
|
|
28
36
|
|
|
37
|
+
<Admonition type="info" icon="" title="">
|
|
38
|
+
Learn more about using this API [here](https://developers.signageos.io/docs/applets/api-guides/key-value-storage)
|
|
39
|
+
</Admonition>
|
|
40
|
+
|
|
29
41
|
The `deleteContent() method removes the value specified by `uid` key.
|
|
30
42
|
|
|
31
43
|
```ts expandable
|
|
@@ -69,6 +81,10 @@ The method throws an error if the uid does not exist or the hashing algorithm is
|
|
|
69
81
|
|
|
70
82
|
### listContents()
|
|
71
83
|
|
|
84
|
+
<Admonition type="info" icon="" title="">
|
|
85
|
+
Learn more about using this API [here](https://developers.signageos.io/docs/applets/api-guides/key-value-storage)
|
|
86
|
+
</Admonition>
|
|
87
|
+
|
|
72
88
|
The `listContent()` method lists all values saved by `saveContent()` method.
|
|
73
89
|
|
|
74
90
|
```ts expandable
|
|
@@ -89,6 +105,10 @@ listFiles(): Promise<string[]>;
|
|
|
89
105
|
|
|
90
106
|
### loadContent()
|
|
91
107
|
|
|
108
|
+
<Admonition type="info" icon="" title="">
|
|
109
|
+
Learn more about using this API [here](https://developers.signageos.io/docs/applets/api-guides/key-value-storage)
|
|
110
|
+
</Admonition>
|
|
111
|
+
|
|
92
112
|
The `loadContent()` method gets the value specified by `uid`, which was previously saved by `saveContent()`.
|
|
93
113
|
|
|
94
114
|
```ts expandable
|
|
@@ -135,6 +155,10 @@ interface IFile {
|
|
|
135
155
|
|
|
136
156
|
### saveContent()
|
|
137
157
|
|
|
158
|
+
<Admonition type="info" icon="" title="">
|
|
159
|
+
Learn more about using this API [here](https://developers.signageos.io/docs/applets/api-guides/key-value-storage)
|
|
160
|
+
</Admonition>
|
|
161
|
+
|
|
138
162
|
The `saveContent()` method saves a string value to the cache.
|
|
139
163
|
|
|
140
164
|
```ts expandable
|
|
@@ -1,5 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 0
|
|
3
|
+
---
|
|
4
|
+
|
|
1
5
|
# offline
|
|
2
6
|
|
|
7
|
+
<Admonition type="info" icon="" title="">
|
|
8
|
+
Learn more about using this API [here](https://developers.signageos.io/docs/applets/api-guides/offline-content#caching-css--javascript-sosoffline)
|
|
9
|
+
</Admonition>
|
|
10
|
+
|
|
3
11
|
The `sos.offline` API groups together methods for storing and using JS, CSS and font files.
|
|
4
12
|
|
|
5
13
|
:::warning
|
package/docs/sos/osd.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 0
|
|
3
|
+
---
|
|
4
|
+
|
|
1
5
|
# osd
|
|
2
6
|
|
|
3
7
|
The `sos.osd` API groups together methods for working with the OSD (On Screen Display).
|
|
@@ -10,4 +14,19 @@ The `showOSD()` method opens the OSD without typing the pin.
|
|
|
10
14
|
|
|
11
15
|
```ts expandable
|
|
12
16
|
showOSD(): Promise<void>;
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## API Example
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
import { sos } from '@signageos/front-applet';
|
|
23
|
+
|
|
24
|
+
void sos.onReady(() => {
|
|
25
|
+
sos.input.onKeyUp(async (e) => {
|
|
26
|
+
if (e.keyName === 'BLUE') {
|
|
27
|
+
await sos.osd.showOSD();
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
|
|
13
32
|
```
|
package/docs/sos/proofOfPlay.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 0
|
|
3
|
+
---
|
|
4
|
+
|
|
1
5
|
# proofOfPlay
|
|
2
6
|
|
|
3
7
|
## Methods
|
|
@@ -22,16 +26,21 @@ interface IRecordItemOptions {
|
|
|
22
26
|
|
|
23
27
|
```
|
|
24
28
|
|
|
25
|
-
|
|
29
|
+
## API Example
|
|
26
30
|
|
|
27
31
|
```ts
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
import { sos } from '@signageos/front-applet';
|
|
33
|
+
|
|
34
|
+
void sos.onReady(async () => {
|
|
35
|
+
await sos.proofOfPlay.recordItemPlayed({
|
|
36
|
+
name: 'generic-brand-christmas-coffee-ad',
|
|
37
|
+
customId: 'dBE43bFB3312VFfvd34bgGHJVV334cd2',
|
|
38
|
+
type: 'video',
|
|
39
|
+
tags: ['generic-brand', 'christmas'],
|
|
40
|
+
fileName: 'coffee.mp4',
|
|
41
|
+
playbackSuccess: false,
|
|
42
|
+
errorMessage: 'Unsupported framerate 60fps',
|
|
43
|
+
});
|
|
36
44
|
});
|
|
45
|
+
|
|
37
46
|
```
|