From d467a54c6c905db5aae1339ce0eea224858c740c Mon Sep 17 00:00:00 2001 From: Darlingnotin Date: Tue, 6 Feb 2024 14:24:09 -0500 Subject: [PATCH] Update videoSyncServerScript.js Adding automatically scaling entity to handle aspect ratio of video playing. --- videoSyncServerScript.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/videoSyncServerScript.js b/videoSyncServerScript.js index 141cda2..44df13f 100644 --- a/videoSyncServerScript.js +++ b/videoSyncServerScript.js @@ -156,6 +156,12 @@ if (useGatewayServer && gatewayServerConnected) { ws.send(JSON.stringify(wsNow)); } + console.log(JSON.stringify(messageData)); + var entity = Entities.getEntityProperties(videoPlayerChannel); + entity.dimensions.y = (entity.dimensions.x / messageData.aspectRatio) + .1 + Entities.editEntity(videoPlayerChannel, { + dimensions: entity.dimensions + }); } else if (messageData.action == "play") { timeStamp = messageData.timeStamp; if (intervalIsRunning) {