@xiboplayer/xmr 0.6.12 → 0.7.0
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/package.json +2 -2
- package/src/xmr-wrapper.js +0 -10
- package/src/xmr-wrapper.test.js +0 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xiboplayer/xmr",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "XMR WebSocket client for real-time Xibo CMS commands",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
".": "./src/index.js"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@xiboplayer/utils": "0.
|
|
12
|
+
"@xiboplayer/utils": "0.7.0"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
15
|
"vitest": "^2.0.0"
|
package/src/xmr-wrapper.js
CHANGED
|
@@ -239,16 +239,6 @@ export class XmrWrapper {
|
|
|
239
239
|
}
|
|
240
240
|
});
|
|
241
241
|
|
|
242
|
-
// CMS command: Screen Shot (alternative event name)
|
|
243
|
-
this.xmr.on('screenshot', async () => {
|
|
244
|
-
log.info('Received screenshot command from CMS');
|
|
245
|
-
try {
|
|
246
|
-
await this.player.captureScreenshot();
|
|
247
|
-
} catch (error) {
|
|
248
|
-
log.error('screenshot failed:', error);
|
|
249
|
-
}
|
|
250
|
-
});
|
|
251
|
-
|
|
252
242
|
// CMS command: Criteria Update
|
|
253
243
|
this.xmr.on('criteriaUpdate', async (data) => {
|
|
254
244
|
log.info('Received criteriaUpdate command:', data);
|
package/src/xmr-wrapper.test.js
CHANGED
|
@@ -222,13 +222,6 @@ describe('XmrWrapper', () => {
|
|
|
222
222
|
expect(mockPlayer.captureScreenshot).toHaveBeenCalled();
|
|
223
223
|
});
|
|
224
224
|
|
|
225
|
-
it('should handle screenshot command (alternative)', async () => {
|
|
226
|
-
xmrInstance.simulateCommand('screenshot');
|
|
227
|
-
await vi.runAllTimersAsync();
|
|
228
|
-
|
|
229
|
-
expect(mockPlayer.captureScreenshot).toHaveBeenCalled();
|
|
230
|
-
});
|
|
231
|
-
|
|
232
225
|
it('should handle screenShot failure gracefully', async () => {
|
|
233
226
|
mockPlayer.captureScreenshot.mockRejectedValue(new Error('Screenshot failed'));
|
|
234
227
|
const consoleErrorSpy = vi.spyOn(console, 'error').mockImplementation(() => {});
|