From 8fb5cfe6d860b611486b6b6b01e93708bd4bfe6f Mon Sep 17 00:00:00 2001 From: Burrowdev Date: Wed, 21 Oct 2026 02:13:42 +0300 Subject: [PATCH] feat(theatre): a video of your own on the theatre screen, fitted to it In a theatre, "Your Video" opens a box for a YouTube, Vimeo or .mp4 / .webm / .mp3 link that plays for that player alone; nothing of it goes to the server. A staff video for the room comes first and the player's own waits for it. The game now tells the page where the theatre's screen is (AJClient.reportTheatreScreen: the original player's 512 by 288, in stage coordinates), so both videos sit exactly on it at any window size. It also tells which parts of it the game's windows, buttons and chat balloons are drawn over, and the page cuts those out of the videos and hides its controls under them: a web page is otherwise always drawn over the game. The box is in the game's own look. Desktop players need client 1.3.2, which lets the game page load the video players and the one file link the player chose. buildVersion 78. Co-Authored-By: Claude Opus 5.5 --- config.js | 2 +- public/game.html | 493 +++++++++++++++++++++++++++++++++++++++++++- swf-src/AJClient.as | 176 ++++++++++++++++ swf/ajclient.swf | Bin 1495668 -> 1496672 bytes 4 files changed, 663 insertions(+), 8 deletions(-) diff --git a/config.js b/config.js index 93f2dba..92b4408 100644 --- a/config.js +++ b/config.js @@ -155,7 +155,7 @@ module.exports = { // 49 and 50: its link to a colour picker. // 61: the Owner, Moderator and Verified name tag badges seen by everyone. // 62: "Custom pictures" in the settings menu, to hide players' item pictures. - buildVersion: env.AJ_BUILD_VERSION || "75", + buildVersion: env.AJ_BUILD_VERSION || "78", // what the official CDN is asked for; not ours to change. upstreamBuildVersion: "3", diff --git a/public/game.html b/public/game.html index cd5b2b0..6acccd3 100644 --- a/public/game.html +++ b/public/game.html @@ -14,24 +14,183 @@ position: relative; z-index: 1; } - #theatre-video { + /* the theatre's screen, as the game says where it is (ajTheatreScreen): + laid over the stage as Flash's "showAll" draws it, every size in + stage pixels times --s. the room's video (staff) and the player's + own both sit on it. */ + @font-face { font-family: "DigitalDelivery"; font-weight: 400; src: url("/fonts/CCDigitalDelivery-Regular.otf") format("opentype"); } + @font-face { font-family: "DigitalDelivery"; font-weight: 700; src: url("/fonts/CCDigitalDelivery-Bold.otf") format("opentype"); } + #theatre { + --s: 1; + --px: calc(var(--s) * 1px); position: fixed; z-index: 2; - display: none; - left: 8.4vw; - top: 6.2vh; - width: 56.8vw; - height: 52.8vh; + overflow: hidden; + pointer-events: none; + font-family: "DigitalDelivery", Arial, Helvetica, sans-serif; + } + #theatre[hidden], #theatre [hidden] { + display: none !important; + } + /* the game draws over it just now (ajTheatreScreen) */ + #theatre .covered { + visibility: hidden; + } + .theatre-screen { + position: absolute; border: 0; background: #000; pointer-events: auto; } + #theatre-video { + display: none; + } #theatre-video.visible { display: block; } + #own-video > * { + width: 100%; + height: 100%; + border: 0; + display: block; + } + /* in the game's own colours: cream panels, brown edges, a green "go" */ + #own-video-open { + position: absolute; + pointer-events: auto; + font: 700 calc(13 * var(--px)) / 1 "DigitalDelivery", Arial, sans-serif; + color: #6d4330; + background: linear-gradient(#fffbe6, #ffe9a6); + border: calc(2 * var(--px)) solid #7f6744; + border-radius: 999px; + padding: calc(6 * var(--px)) calc(14 * var(--px)); + box-shadow: 0 calc(2 * var(--px)) 0 #7f6744; + cursor: pointer; + white-space: nowrap; + } + #own-video-open:hover { + background: linear-gradient(#fffef5, #fff0be); + } + #own-video-open:active { + transform: translateY(calc(2 * var(--px))); + box-shadow: none; + } + #own-video-box { + position: absolute; + pointer-events: auto; + box-sizing: border-box; + width: calc(360 * var(--px)); + padding: calc(14 * var(--px)) calc(16 * var(--px)) calc(12 * var(--px)); + color: #6d4330; + font-size: calc(13 * var(--px)); + background: #fff2c4; + border: calc(4 * var(--px)) solid #7f6744; + border-radius: calc(18 * var(--px)); + box-shadow: inset 0 0 0 calc(2 * var(--px)) #ffe39a, 0 calc(4 * var(--px)) 0 rgba(0, 0, 0, 0.35); + } + #own-video-box h2 { + margin: 0 calc(24 * var(--px)) calc(10 * var(--px)) 0; + font-size: calc(20 * var(--px)); + font-weight: 700; + color: #fff; + letter-spacing: 0.02em; + text-shadow: 0 0 calc(2 * var(--px)) #6d4330, calc(1.5 * var(--px)) calc(1.5 * var(--px)) 0 #6d4330, calc(-1.5 * var(--px)) calc(1.5 * var(--px)) 0 #6d4330, calc(1.5 * var(--px)) calc(-1.5 * var(--px)) 0 #6d4330, calc(-1.5 * var(--px)) calc(-1.5 * var(--px)) 0 #6d4330; + } + #own-video-url { + box-sizing: border-box; + width: 100%; + font: 400 calc(13 * var(--px)) / 1.2 Arial, Helvetica, sans-serif; + color: #3d2716; + background: #fff; + border: calc(2 * var(--px)) solid #c9a86a; + border-radius: calc(9 * var(--px)); + padding: calc(7 * var(--px)) calc(9 * var(--px)); + box-shadow: inset 0 calc(2 * var(--px)) calc(3 * var(--px)) rgba(109, 67, 48, 0.25); + outline: none; + } + #own-video-url:focus { + border-color: #7f6744; + } + #own-video-url::placeholder { + color: #a88f6a; + } + .own-video-buttons { + display: flex; + justify-content: center; + gap: calc(10 * var(--px)); + margin-top: calc(10 * var(--px)); + } + .aj-button { + min-width: calc(88 * var(--px)); + font: 700 calc(15 * var(--px)) / 1 "DigitalDelivery", Arial, sans-serif; + color: #fff; + border-radius: 999px; + padding: calc(7 * var(--px)) calc(16 * var(--px)); + cursor: pointer; + text-shadow: 0 calc(1.5 * var(--px)) 0 rgba(0, 0, 0, 0.45); + } + .aj-button:active { + transform: translateY(calc(2 * var(--px))); + box-shadow: none !important; + } + .aj-button.go { + background: linear-gradient(#a6e05a, #4fa52f); + border: calc(2 * var(--px)) solid #2f7420; + box-shadow: inset 0 calc(2 * var(--px)) 0 rgba(255, 255, 255, 0.45), 0 calc(2 * var(--px)) 0 #2f7420; + } + .aj-button.go:hover { + background: linear-gradient(#b5ea6c, #5cb43a); + } + .aj-button.stop { + background: linear-gradient(#f59a6a, #d4482a); + border: calc(2 * var(--px)) solid #8e2b16; + box-shadow: inset 0 calc(2 * var(--px)) 0 rgba(255, 255, 255, 0.4), 0 calc(2 * var(--px)) 0 #8e2b16; + } + .aj-button.stop:hover { + background: linear-gradient(#ffab7c, #e05634); + } + #own-video-close { + position: absolute; + top: calc(-10 * var(--px)); + right: calc(-10 * var(--px)); + width: calc(30 * var(--px)); + height: calc(30 * var(--px)); + padding: 0; + font: 700 calc(18 * var(--px)) / 1 Arial, sans-serif; + color: #fff; + background: radial-gradient(circle at 50% 35%, #ff7a5c, #c8321a 70%); + border: calc(3 * var(--px)) solid #fff; + border-radius: 50%; + box-shadow: 0 0 0 calc(2 * var(--px)) #7f6744, 0 calc(2 * var(--px)) 0 calc(2 * var(--px)) rgba(0, 0, 0, 0.3); + cursor: pointer; + } + #own-video-close:hover { + background: radial-gradient(circle at 50% 35%, #ff8f74, #d93d22 70%); + } + #own-video-said { + min-height: calc(15 * var(--px)); + margin: calc(8 * var(--px)) 0 0; + font: 400 calc(12 * var(--px)) / 1.25 Arial, Helvetica, sans-serif; + color: #a3341c; + text-align: center; + } - +