@xibosignage/xibo-communication-framework 0.0.4 → 0.0.5
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/README.md +50 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -47,4 +47,53 @@ let xmrWebSocketAddress = config.getSetting(
|
|
|
47
47
|
cmsUrl.replace(window.location.protocol, protocol) + '/xmr'
|
|
48
48
|
);
|
|
49
49
|
xmr.start(xmrWebSocketAddress, config.getSetting('xmrCmsKey', 'n/a'));
|
|
50
|
-
```
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### XMR Events
|
|
53
|
+
There are existing events that are already defined that correspond to actions done from the CMS.
|
|
54
|
+
|
|
55
|
+
`collectNow`
|
|
56
|
+
|
|
57
|
+
An action in the CMS through a Display that overrides the collection interval function.
|
|
58
|
+
|
|
59
|
+
`screenShot`
|
|
60
|
+
|
|
61
|
+
An action in the CMS through a Display that requests a screenshot from the player and made available in the CMS for the related display.
|
|
62
|
+
|
|
63
|
+
`licenceCheck`
|
|
64
|
+
|
|
65
|
+
An action in the CMS through a Display that checks the licence of the player.
|
|
66
|
+
|
|
67
|
+
`showStatusWindow`
|
|
68
|
+
|
|
69
|
+
A Display command “Show Status Window” which shows the status window in the player. (In this case, ChromeOS player)
|
|
70
|
+
|
|
71
|
+
`forceUpdateChromeOS`
|
|
72
|
+
|
|
73
|
+
A Display command “Force update ChromeOS” that forces the ChromeOS player to update to the set version from the display settings.
|
|
74
|
+
|
|
75
|
+
These events are available through this TypeScript interface below. We can add events through this interface.
|
|
76
|
+
|
|
77
|
+
```typescript
|
|
78
|
+
export interface XmrEvents {
|
|
79
|
+
connected: () => void;
|
|
80
|
+
disconnected: () => void;
|
|
81
|
+
error: (e: string) => void;
|
|
82
|
+
statusChange: (status: string) => void;
|
|
83
|
+
collectNow: () => void;
|
|
84
|
+
screenShot: () => void;
|
|
85
|
+
licenceCheck: () => void;
|
|
86
|
+
showStatusWindow: (timeout: number) => void;
|
|
87
|
+
forceUpdateChromeOS: () => void;
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
On the consuming player, we can listen to these events and make necessary actions using a callback.
|
|
92
|
+
|
|
93
|
+
```typescript
|
|
94
|
+
...
|
|
95
|
+
xmr.on('collectNow', () => {
|
|
96
|
+
xmds.collectNow();
|
|
97
|
+
});
|
|
98
|
+
...
|
|
99
|
+
```
|
package/package.json
CHANGED