An Australian live-television PWA combining regional JSON programme data, HLS playback and a responsive channel guide.
Application architecture
Built with HTML, CSS and vanilla JavaScript, with separate scripts for application logic, configuration and installation. Central configuration defines the channel list, city feeds and logo overrides. Listings and streams are requested directly from their providers, without an application backend, sign-in or streaming proxy.
Vanilla JavaScriptStatic hostingConfiguration mapping
Regional programme-guide processing
Eight state and territory choices map to capital-city JSON feeds. Each feed is an object keyed by channel ID, with programme entries stored as Unix timestamp and title pairs. Timestamp comparisons identify the current programme and the next two entries, calculate progress and countdowns, and order channels by their broadcast numbers.
Schedules are retained in memory and rendered every minute. Downloads occur on startup, when changing region and every four hours. This keeps the guide current without requesting the full feed each minute.
Regional JSONUnix timestampsNow / Next / Later
Streaming lifecycle
HTML5 video uses HLS.js where supported, with a native HLS path for compatible browsers. Channel changes destroy the previous HLS.js player and guard against callbacks from a disposed instance. Native playback replaces its metadata handler on each switch to avoid accumulating listeners. Stopping playback clears the media source and restores the guide.
HLS.jsNative HLSPlayer cleanup
Data recovery and asset fallbacks
Request sequencing prevents a slow response from a previous region replacing the latest selection. Failed downloads retain the last successful guide, identify which region it belongs to and offer a retry. Configurable logo overrides accept local paths or remote URLs; unavailable logos use text badges. Failed image URLs are remembered for the session so minute-by-minute guide updates do not repeatedly request them.
Request sequencingLast successful guideLogo fallbacks
Responsive interface and PWA installation
A full-screen video surface sits behind a sliding guide. Whole-card controls support touch and keyboard input, while dynamic viewport units and safe-area insets accommodate mobile browser chrome and screen cutouts. Native dialogs provide modal focus handling for region selection and project information.
The web app manifest supports installation. The menu opens the browser's install prompt when available and provides manual instructions otherwise. The network-only service worker leaves resource requests to the browser; video and listings are not stored for offline use.
CSS safe areasKeyboard accessNative dialogsWeb app manifest
Verification
Regression checks use the Node.js test runner and isolated JavaScript contexts to exercise guide rendering, programme rollover, region-response ordering, image failures, player cleanup and installation events. Browser checks cover phone and desktop layouts, menu controls and installed-app states. Direct ABC TV playback was also verified through an advancing media clock and a successful return to the guide after stopping.
node:testVM contextsBrowser checksLive HLS playback
An independent portfolio project by digitalstream / Better Media Hub. Regional listings are provided by Matt Huisman.
Freeview branding, broadcaster logos, listings and streams belong to their respective owners. This project is not affiliated with Freeview or the broadcasters.
Visit Better Media Hub ↗