From d94ab958d56751d341a18816d8ad8806c99f2e0b Mon Sep 17 00:00:00 2001 From: Josh Patra <30350506+SoPat712@users.noreply.github.com> Date: Sun, 6 Jul 2025 19:40:25 -0400 Subject: [PATCH] failing to appear, making it more consistent --- inject.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/inject.js b/inject.js index 45ef9b8..93cf849 100644 --- a/inject.js +++ b/inject.js @@ -315,8 +315,15 @@ function defineVideoController() { tc.videoController.prototype.initializeControls = function () { const doc = this.video.ownerDocument; const speed = this.video.playbackRate.toFixed(2); - var top = Math.max(this.video.offsetTop, 0) + "px", + // Fix for videos rendered after page load - use relative positioning + var top = "10px", + left = "10px"; + + // Try to get actual position, but fallback to default if not available + if (this.video.offsetTop > 0 || this.video.offsetLeft > 0) { + top = Math.max(this.video.offsetTop, 0) + "px"; left = Math.max(this.video.offsetLeft, 0) + "px"; + } var wrapper = doc.createElement("div"); wrapper.classList.add("vsc-controller"); if (!this.video.src && !this.video.currentSrc)