diff --git a/config/streamer-minecraft-tg.env.example b/config/streamer-minecraft-tg.env.example index f1f6ef6..7bbe7c5 100644 --- a/config/streamer-minecraft-tg.env.example +++ b/config/streamer-minecraft-tg.env.example @@ -16,6 +16,8 @@ FRAMERATE=30 RESOLUTION=1920x1080 STATION_TUNE_IN_URL=denpa.femboy.page +# set to false to hide all "denpa.fm" branding + links in the overlay +BRANDING=true ICECAST_STATUS_URL=http://icecast:8000/status-json.xsl diff --git a/streamer/src/config.ts b/streamer/src/config.ts index ca0a363..3c88862 100644 --- a/streamer/src/config.ts +++ b/streamer/src/config.ts @@ -21,6 +21,7 @@ export interface Config { stationDisplayName?: string; stationTagline?: string; stationTuneInUrl: string; + branding: boolean; healthPort: number; logLevel: "debug" | "info" | "warn" | "error"; icecastStatusUrl?: string; @@ -77,6 +78,7 @@ export function loadConfig(env: Record = process.env stationDisplayName: env.STATION_DISPLAY_NAME || undefined, stationTagline: env.STATION_TAGLINE || undefined, stationTuneInUrl: env.STATION_TUNE_IN_URL ?? "denpa.femboy.page", + branding: (env.BRANDING ?? "true").toLowerCase() !== "false", healthPort: Number(env.HEALTH_PORT ?? 12010), logLevel, icecastStatusUrl: env.ICECAST_STATUS_URL || undefined, diff --git a/streamer/src/index.ts b/streamer/src/index.ts index 28bbf65..a232983 100644 --- a/streamer/src/index.ts +++ b/streamer/src/index.ts @@ -34,6 +34,7 @@ async function main() { station: cfg.station, tz: cfg.tz, tuneInUrl: cfg.stationTuneInUrl, + branding: cfg.branding, }); const pcm = new PcmTap({ host: cfg.pcmHost, port: cfg.pcmPort }); diff --git a/streamer/src/page-server.ts b/streamer/src/page-server.ts index 262c371..fb0a2c8 100644 --- a/streamer/src/page-server.ts +++ b/streamer/src/page-server.ts @@ -11,6 +11,7 @@ export interface PageServerOpts { station: string; tz: string; tuneInUrl: string; + branding: boolean; } export class PageServer extends EventEmitter { @@ -77,6 +78,7 @@ export class PageServer extends EventEmitter { station: this.opts.station, tz: this.opts.tz, tuneInUrl: this.opts.tuneInUrl, + branding: this.opts.branding, })}`; let html = ""; createReadStream(indexPath, "utf8") diff --git a/streamer/src/views/App.tsx b/streamer/src/views/App.tsx index 1bfc2af..541f95a 100644 --- a/streamer/src/views/App.tsx +++ b/streamer/src/views/App.tsx @@ -5,7 +5,7 @@ import { StreamModern } from "./modern.tsx"; declare global { interface Window { - __STREAMER_CONFIG__: { style: "denpa" | "modern"; station: string; tz: string; tuneInUrl: string }; + __STREAMER_CONFIG__: { style: "denpa" | "modern"; station: string; tz: string; tuneInUrl: string; branding: boolean }; } } diff --git a/streamer/src/views/denpa.tsx b/streamer/src/views/denpa.tsx index ac67654..69370c1 100644 --- a/streamer/src/views/denpa.tsx +++ b/streamer/src/views/denpa.tsx @@ -6,7 +6,7 @@ import { fmtMs, fmtClock, fmtClockSec, fmtJpDate } from "./shared/format.ts"; const KAOMOJI_STREAM = ["(´。• ᵕ •。`)", "٩(◕‿◕)۶", "(。◕‿◕。)", "(>ω<)", "(✿◠‿◠)"]; -interface Cfg { station: string; tz: string; tuneInUrl: string; } +interface Cfg { station: string; tz: string; tuneInUrl: string; branding: boolean; } interface Listeners { current: number; peak: number; } interface Props { cfg: Cfg; listeners: Listeners; } @@ -148,15 +148,19 @@ export function StreamDenpa({ cfg, listeners }: Props) { `}
-
-
電波 TRANSMISSION
- denpa.fm -
-
- {channel} ←
- {nameJp}
- {"<3"} block radio -
+ {cfg.branding && ( + <> +
+
電波 TRANSMISSION
+ denpa.fm +
+
+ {channel} ←
+ {nameJp}
+ {"<3"} block radio +
+ + )}
[REC] ON AIR
{fmtJpDate(now)}
@@ -245,15 +249,17 @@ export function StreamDenpa({ cfg, listeners }: Props) {
SIDE A · CH.01
{/* Bottom strip */} -
-
>> tune in @ {cfg.tuneInUrl}
-
-
- ※ now broadcasting from a small room in tokyo ※ 24/7 always-on {cfg.station} station ※ stream URL: {cfg.tuneInUrl} ※ requests via @denpa_bot ※ no ads · no algorithms · just blocks ※ {KAOMOJI_STREAM.join(" ※ ")} ※ + {cfg.branding && ( +
+
>> tune in @ {cfg.tuneInUrl}
+
+
+ ※ now broadcasting from a small room in tokyo ※ 24/7 always-on {cfg.station} station ※ stream URL: {cfg.tuneInUrl} ※ requests via @denpa_bot ※ no ads · no algorithms · just blocks ※ {KAOMOJI_STREAM.join(" ※ ")} ※ +
+
{fmtClock(now)}
-
{fmtClock(now)}
-
+ )}
); } diff --git a/streamer/src/views/modern.tsx b/streamer/src/views/modern.tsx index 84a8f6c..6236b3a 100644 --- a/streamer/src/views/modern.tsx +++ b/streamer/src/views/modern.tsx @@ -4,7 +4,7 @@ import { useSpectrum } from "./shared/useSpectrum.ts"; import { useElapsed } from "./shared/useElapsed.ts"; import { fmtMs, fmtClock } from "./shared/format.ts"; -interface Cfg { station: string; tz: string; tuneInUrl: string; } +interface Cfg { station: string; tz: string; tuneInUrl: string; branding: boolean; } interface Listeners { current: number; peak: number; } interface Props { cfg: Cfg; listeners: Listeners; } @@ -202,10 +202,12 @@ export function StreamModern({ cfg, listeners }: Props) {
-
- - denpa.fm — {cfg.station} -
+ {cfg.branding && ( +
+ + denpa.fm — {cfg.station} +
+ )}
Live
@@ -221,7 +223,6 @@ export function StreamModern({ cfg, listeners }: Props) {
Now playing - {cfg.station}

{np.title}

{np.artist}
@@ -255,11 +256,13 @@ export function StreamModern({ cfg, listeners }: Props) {
-
- Tune in at {cfg.tuneInUrl} - {listeners.current} listeners · 24/7 · auto-DJ - {cfg.tuneInUrl} -
+ {cfg.branding && ( +
+ Tune in at {cfg.tuneInUrl} + {listeners.current} listeners · 24/7 · auto-DJ + {cfg.tuneInUrl} +
+ )}
); }