From f5feca7dfabe2dcd7830528679c88e0965a93759 Mon Sep 17 00:00:00 2001 From: David Keane Date: Fri, 29 May 2026 23:42:09 +0100 Subject: [PATCH] =?UTF-8?q?feat(0.4.0):=20now-playing=20indicator=20?= =?UTF-8?q?=E2=80=94=20dancing=20bars=20+=20Web=20Audio=20visualizer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two-layer "this is playing right now" visual: (1) CSS dancing bars — four tiny vertical bars next to the "Now Playing" label, staggered `@keyframes` pulse while audio plays. Pure CSS, no JS dependency, tints to the user's WP admin colour scheme via var(--wp-admin-theme-color). Driven by a single `.is-playing` class on `.radio-player` toggled from the existing play/pause/error handlers. Always works. (2) Web Audio frequency visualizer (progressive upgrade) — on first play, builds AudioContext + AnalyserNode + canvas drawing pipeline. When the analyser starts returning real (non-zero) data, hides the bars and shows the canvas with live frequency bars. Falls back to bars if AudioContext is unavailable, createMediaElementSource throws, or the analyser returns all-zeros for >2s (CORS silently blocking). State machine on player._vizState: no-webaudio / init-failed / cors-blocked / ok. `