Release v2.10.4
This commit is contained in:
1 parent
3f4f57020a
commit
ca9f38f3b9
22 files changed
+277
-164
No files matched your search
@@ -916,8 +916,11 @@ async function start() {
|
||||
return res.status(404).json({ ok: false, error: 'Player is not connected.' });
|
||||
}
|
||||
|
||||
socket.send(JSON.stringify(payload));
|
||||
res.json({ ok: true, deviceId: deviceId, sent: true });
|
||||
const response = await sendPlayerCommandToSocket(socket, payload);
|
||||
res.status(response && response.ok ? 200 : (response && response.status || 502)).json(Object.assign({
|
||||
deviceId: deviceId,
|
||||
connectionId: payload.connectionId || null
|
||||
}, response && typeof response === 'object' ? response : { ok: false }));
|
||||
} catch (error) {
|
||||
next(error);
|
||||
}
|
||||
@@ -975,9 +978,14 @@ async function start() {
|
||||
const snapshotPlayerPublicBaseUrl = String(payload.playerPublicBaseUrl || socket.publicBaseUrl || '').trim().replace(/\/$/, '');
|
||||
const connections = Array.isArray(payload.connections) ? payload.connections.map(function (connection) {
|
||||
if (!connection || typeof connection !== 'object' || !snapshotPlayerPublicBaseUrl) {
|
||||
return connection;
|
||||
return connection && typeof connection === 'object'
|
||||
? Object.assign({}, connection, { playerDeviceId: deviceId })
|
||||
: connection;
|
||||
}
|
||||
return Object.assign({}, connection, { playerPublicBaseUrl: snapshotPlayerPublicBaseUrl });
|
||||
return Object.assign({}, connection, {
|
||||
playerDeviceId: deviceId,
|
||||
playerPublicBaseUrl: snapshotPlayerPublicBaseUrl
|
||||
});
|
||||
}) : [];
|
||||
setScreenSnapshotSource(slug, deviceId, connections);
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user