From b062644f7bca46e24faa62ef758ee8c935f294d1 Mon Sep 17 00:00:00 2001 From: Michael Hollister Date: Wed, 20 Nov 2024 15:27:44 -0600 Subject: [PATCH] Collection of small fixes --- receivers/electron/src/main/style.css | 4 +-- receivers/electron/src/player/Renderer.ts | 31 ++++++++++++++++++++--- receivers/electron/src/player/style.css | 8 ++---- 3 files changed, 31 insertions(+), 12 deletions(-) diff --git a/receivers/electron/src/main/style.css b/receivers/electron/src/main/style.css index 134f951..aad6665 100644 --- a/receivers/electron/src/main/style.css +++ b/receivers/electron/src/main/style.css @@ -117,8 +117,8 @@ body, html { #title-text { font-family: Outfit; - font-size: 96px; - font-weight: bold; + font-size: 100px; + font-weight: 800; text-align: center; background-image: linear-gradient(180deg, #FFFFFF 5.9%, #D3D3D3 100%); diff --git a/receivers/electron/src/player/Renderer.ts b/receivers/electron/src/player/Renderer.ts index e45b966..2fcf1f7 100644 --- a/receivers/electron/src/player/Renderer.ts +++ b/receivers/electron/src/player/Renderer.ts @@ -186,7 +186,6 @@ window.electronAPI.onPlay((_event, value: PlayMessage) => { dashPlayer.on(dashjs.MediaPlayer.events.STREAM_INITIALIZED, () => { onPlayerLoad(value, currentPlaybackRate, currentVolume); }); dashPlayer.on(dashjs.MediaPlayer.events.CUE_ENTER, (e: any) => { - // console.log("cueEnter", e); const subtitle = document.createElement("p") subtitle.setAttribute("id", "subtitle-" + e.cueID) @@ -195,8 +194,7 @@ window.electronAPI.onPlay((_event, value: PlayMessage) => { }); dashPlayer.on(dashjs.MediaPlayer.events.CUE_EXIT, (e: any) => { - // console.log("cueExit ", e); - document.getElementById("subtitle-" + e.cueID).remove(); + document.getElementById("subtitle-" + e.cueID)?.remove(); }); dashPlayer.updateSettings({ @@ -416,11 +414,26 @@ function playerCtrlStateUpdate(event: PlayerControlEvent) { case PlayerControlEvent.UiFadeOut: document.body.style.cursor = "none"; playerControls.setAttribute("style", "opacity: 0"); + + if (player.isCaptionsEnabled()) { + videoCaptions.setAttribute("style", "display: block; bottom: 75px;"); + } else { + videoCaptions.setAttribute("style", "display: block; bottom: 75px;"); + } + + break; case PlayerControlEvent.UiFadeIn: document.body.style.cursor = "default"; playerControls.setAttribute("style", "opacity: 1"); + + if (player.isCaptionsEnabled()) { + videoCaptions.setAttribute("style", "display: block; bottom: 150px;"); + } else { + videoCaptions.setAttribute("style", "display: block; bottom: 150px;"); + } + break; case PlayerControlEvent.SetCaptions: @@ -644,7 +657,17 @@ function stopUiHideTimer() { } } -document.onmousemove = function() { +document.onmouseout = () => { + if (uiHideTimer) { + window.clearTimeout(uiHideTimer); + uiHideTimer = null; + } + + uiVisible = false; + playerCtrlStateUpdate(PlayerControlEvent.UiFadeOut); +} + +document.onmousemove = () => { stopUiHideTimer(); if (player && !player.isPaused()) { diff --git a/receivers/electron/src/player/style.css b/receivers/electron/src/player/style.css index f216e42..7d9f2b6 100644 --- a/receivers/electron/src/player/style.css +++ b/receivers/electron/src/player/style.css @@ -184,6 +184,7 @@ body { } .progressBarPosition { + display: none; position: absolute; bottom: 25px; padding: 2px 5px; @@ -435,12 +436,7 @@ body { width: fit-content; - /* display: flex; */ - /* align-items: center; */ - /* min-width: 100%; */ - /* height: 100px; */ - /* text-overflow: ellipsis; */ - /* overflow: hidden; */ + transition: bottom 0.2s ease-in-out; } .speedMenu {