From cda09483deb3bf1eb4d1bab29b1fb336ce436710 Mon Sep 17 00:00:00 2001 From: Blake Erickson Date: Mon, 19 Feb 2024 12:46:45 -0700 Subject: [PATCH] FIX: Set the video background to be black (#25744) If you upload a portrait video or just a video that doesn't fit in the normal video dimensions we want it to have a black background instead of trying to render parts of the placeholder image as the video background. This change removes the placeholder image for the video background when the play button is clicked and replaces it with an all black background. --- .../discourse/app/instance-initializers/video-placeholder.js | 1 + app/assets/stylesheets/common/base/onebox.scss | 1 + 2 files changed, 2 insertions(+) diff --git a/app/assets/javascripts/discourse/app/instance-initializers/video-placeholder.js b/app/assets/javascripts/discourse/app/instance-initializers/video-placeholder.js index 32201ba9f1d..9deb040a700 100644 --- a/app/assets/javascripts/discourse/app/instance-initializers/video-placeholder.js +++ b/app/assets/javascripts/discourse/app/instance-initializers/video-placeholder.js @@ -67,6 +67,7 @@ export default { wrapper.remove(); video.style.display = ""; parentDiv.classList.remove("video-placeholder-container"); + parentDiv.style.backgroundImage = "none"; }); } diff --git a/app/assets/stylesheets/common/base/onebox.scss b/app/assets/stylesheets/common/base/onebox.scss index 99eeb9c1dcf..7393c5e456b 100644 --- a/app/assets/stylesheets/common/base/onebox.scss +++ b/app/assets/stylesheets/common/base/onebox.scss @@ -927,6 +927,7 @@ aside.onebox.mixcloud-preview { position: relative; padding: 0 0 56.25% 0; width: 100%; + background-color: black; video { position: absolute;