Skip to content

Commit 6a26af0

Browse files
committed
feat: add disableHeaderVideo parameter to kiosk mode and update README
1 parent 717260b commit 6a26af0

File tree

3 files changed

+22
-9
lines changed

3 files changed

+22
-9
lines changed

README.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,18 @@ Kiosk mode is controlled via URL query parameters and works globally from the ro
1111
### Query parameters
1212

1313
- `kiosk`
14-
- Enables auto-rotation when present as `?kiosk`, `?kiosk=1`, or `?kiosk=true`.
15-
- Disabled by default.
14+
- Enables auto-rotation when present as `?kiosk`, `?kiosk=1`, or `?kiosk=true`.
15+
- Disabled by default.
1616
- `interval`
17-
- Rotation interval in **seconds**.
18-
- Default: `10`
19-
- Allowed range: `1` to `3600`
17+
- Rotation interval in **seconds**.
18+
- Default: `10`
19+
- Allowed range: `1` to `3600`
2020
- `playlist`
21-
- Comma-separated list of routes to rotate through.
22-
- Can be aliases (see below), relative route fragments, or absolute paths.
21+
- Comma-separated list of routes to rotate through.
22+
- Can be aliases (see below), relative route fragments, or absolute paths.
23+
- `disableHeaderVideo`
24+
- Disables video in the hero header and forces image usage when an image exists.
25+
- Enabled when present as `?disableHeaderVideo`, `?disableHeaderVideo=1`, or `?disableHeaderVideo=true`.
2326

2427
### Playlist aliases
2528

@@ -49,6 +52,7 @@ If `playlist` is not provided and the current route includes a musical slug, the
4952
- `http://localhost:5173/hamilton?kiosk=1&interval=20`
5053
- `http://localhost:5173/hamilton?kiosk=1&interval=10&playlist=cast,crew,gallery,external-ads`
5154
- `http://localhost:5173/hamilton?kiosk=1&playlist=/hamilton/cast,/hamilton/gallery`
55+
- `http://localhost:5173/hamilton?kiosk=1&disableHeaderVideo=1`
5256

5357
## Developing
5458

src/routes/[musical]/(heroimage)/+layout.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
55
const { data, children } = $props<{ data: LayoutData; children: Snippet }>();
66
const showData = $derived(data.showData);
7+
const disableHeaderVideo = $derived(data.disableHeaderVideo ?? false);
78
</script>
89

9-
{#if showData?.common?.media?.video}
10+
{#if !disableHeaderVideo && showData?.common?.media?.video}
1011
<video
1112
autoplay
1213
loop

src/routes/[musical]/(heroimage)/+layout.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@ import type { LayoutLoad } from './$types';
22

33
export const load: LayoutLoad = ({ url }) => {
44
const date = url.searchParams.get('date');
5+
const disableHeaderVideoParam = url.searchParams.get('disableHeaderVideo');
6+
const disableHeaderVideo =
7+
disableHeaderVideoParam === '' ||
8+
disableHeaderVideoParam === '1' ||
9+
disableHeaderVideoParam?.toLowerCase() === 'true';
510

6-
return { date };
11+
return {
12+
date,
13+
disableHeaderVideo
14+
};
715
};

0 commit comments

Comments
 (0)