From d8d698012f0ada4f85547fb6fa4f632d7b8447f2 Mon Sep 17 00:00:00 2001 From: Kristoffer Date: Tue, 10 Dec 2024 13:34:47 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=BA=20Video=20preview=20controls=20out?= =?UTF-8?q?put=20if=20playing=20-=20Fixed=20video=20slider=20time=20set=20?= =?UTF-8?q?to=200=20sometimes=20if=20paused=20-=20Fixed=20audio=20playlist?= =?UTF-8?q?=20looping=20sometimes=20when=20it=20should=20not=20-=20Fixed?= =?UTF-8?q?=20next=20after=20media=20finished=20not=20working=20for=20mult?= =?UTF-8?q?iple=20outputs=20-=20Fixed=20output=20style=20adding=20template?= =?UTF-8?q?=20textbox=20when=20slide=20has=20none?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/lang/en.json | 4 +- src/frontend/components/helpers/audio.ts | 3 +- src/frontend/components/helpers/output.ts | 2 +- .../components/helpers/showActions.ts | 8 +- .../components/output/VideoSlider.svelte | 9 +- .../output/tools/MediaControls.svelte | 39 +++-- src/frontend/components/show/VideoShow.svelte | 136 ++++++++++++------ src/frontend/utils/receivers.ts | 8 +- 8 files changed, 135 insertions(+), 74 deletions(-) diff --git a/public/lang/en.json b/public/lang/en.json index d37ea38a..5c021cc3 100644 --- a/public/lang/en.json +++ b/public/lang/en.json @@ -413,7 +413,7 @@ "import": "Import", "songbeamer_import": "Songbeamer Import", "export": "Export", - "importing": "Importing", + "importing": "Importing...", "import_scripture": "Import scripture", "player": "Player", "edit_event": "Edit event", @@ -737,7 +737,7 @@ "export": { "export": "Export", "export_as": "Export {} as", - "exporting": "Exporting", + "exporting": "Exporting...", "exported": "Exported!", "oneFile": "One file", "selected_shows": "Selected shows", diff --git a/src/frontend/components/helpers/audio.ts b/src/frontend/components/helpers/audio.ts index 46cfea5a..12ef42b8 100644 --- a/src/frontend/components/helpers/audio.ts +++ b/src/frontend/components/helpers/audio.ts @@ -467,7 +467,8 @@ function getPlayingAudio() { get(playingAudio)[audioPath].audio.currentTime = 0 get(playingAudio)[audioPath].audio.play() } else if (get(activePlaylist)?.active === audioPath) { - let playlist = get(audioPlaylists)[audioPath] || {} + let playlistId = get(activePlaylist).id || "" + let playlist = get(audioPlaylists)[playlistId] || {} playingAudio.update((a: any) => { a[audioPath]?.audio?.pause() diff --git a/src/frontend/components/helpers/output.ts b/src/frontend/components/helpers/output.ts index e5243549..a5465372 100644 --- a/src/frontend/components/helpers/output.ts +++ b/src/frontend/components/helpers/output.ts @@ -526,7 +526,7 @@ export function getCurrentMediaTransition() { // TEMPLATE export function mergeWithTemplate(slideItems: Item[], templateItems: Item[], addOverflowTemplateItems: boolean = false, resetAutoSize: boolean = true) { - if (!slideItems) return [] + if (!slideItems?.length) return [] slideItems = clone(slideItems) if (!templateItems.length) return slideItems diff --git a/src/frontend/components/helpers/showActions.ts b/src/frontend/components/helpers/showActions.ts index 92b0fd6c..27156371 100644 --- a/src/frontend/components/helpers/showActions.ts +++ b/src/frontend/components/helpers/showActions.ts @@ -798,13 +798,13 @@ export function playNextGroup(globalGroupIds: string[], { showRef, outSlide, cur } // go to next slide if current output slide has nextAfterMedia action -let nextActive = false +let nextActive: string[] = [] export function checkNextAfterMedia(endedId: string, type: "media" | "audio" | "timer" = "media", outputId: string = "") { - if (nextActive) return false + if (nextActive.includes(outputId)) return false - nextActive = true + nextActive.push(outputId) setTimeout(() => { - nextActive = false + nextActive.splice(nextActive.indexOf(outputId), 1) }, 600) // MAKE SURE NEXT SLIDE HAS TRANSITIONED if (!outputId) outputId = getActiveOutputs(get(outputs), true, true, true)[0] diff --git a/src/frontend/components/output/VideoSlider.svelte b/src/frontend/components/output/VideoSlider.svelte index 8a0c0413..7b22d3fa 100644 --- a/src/frontend/components/output/VideoSlider.svelte +++ b/src/frontend/components/output/VideoSlider.svelte @@ -9,6 +9,7 @@ export let activeOutputIds: string[] = [] export let unmutedId: string = "" export let toOutput: boolean = false + export let big: boolean = false export let disabled: boolean = false export let changeValue: number = 0 @@ -103,7 +104,7 @@ }} /> -
+
{#if hover} {time} @@ -146,6 +147,9 @@ margin: 0 5px; font-size: 0.8em; } + .main.big { + font-size: 1em; + } .slider { flex: 1; @@ -154,4 +158,7 @@ display: flex; align-items: center; } + .main.big .slider { + margin: 0 10px; + } diff --git a/src/frontend/components/output/tools/MediaControls.svelte b/src/frontend/components/output/tools/MediaControls.svelte index 82a43193..dcd25087 100644 --- a/src/frontend/components/output/tools/MediaControls.svelte +++ b/src/frontend/components/output/tools/MediaControls.svelte @@ -12,6 +12,7 @@ export let currentOutput: any export let outputId: string + export let big: boolean = false $: videoData = $videosData[outputId] || {} @@ -26,6 +27,7 @@ // custom time update (for player videos) onMount(() => { + if ($videosTime[outputId]) videoTime = $videosTime[outputId] setInterval(() => { if (videoData.paused || timeJustUpdated) return videoTime++ @@ -89,21 +91,23 @@ {#if background} - - {#if background?.type === "player"} -

{$playerVideos[background?.id || ""]?.name || "—"}

- {:else} -

{mediaName}

- {/if} -
+ {#if !big} + + {#if background?.type === "player"} +

{$playerVideos[background?.id || ""]?.name || "—"}

+ {:else} +

{mediaName}

+ {/if} +
+ {/if} {#if type === "video" || background?.type === "player"} - + - + {/if} @@ -159,6 +163,13 @@ padding: 0.3em !important; } + .group.big { + background-color: var(--primary-darkest); + } + .group.big :global(.slider input) { + background-color: var(--primary); + } + .name { display: flex; justify-content: center; diff --git a/src/frontend/components/show/VideoShow.svelte b/src/frontend/components/show/VideoShow.svelte index 953e5afb..6e4d8870 100644 --- a/src/frontend/components/show/VideoShow.svelte +++ b/src/frontend/components/show/VideoShow.svelte @@ -1,6 +1,6 @@