IvPlayer
webOS Smart TV Low-Latency Media Engine & Spatial Navigation
The Operational Problem
Context & Domain
Smart TVs are long-lifecycle consumer devices. Millions of households use TVs running low-power ARM system-on-chips with 512MB to 1GB total RAM shared between the OS, window compositor, and foreground application. Running modern heavy JavaScript frameworks on these devices frequently causes freeze frames, audio-video desync, and OS watchdog crashes.
Overview
The application had to sustain uninterrupted 4K/1080p HLS video streams, load channel playlists with thousands of entries, maintain buttery-smooth 60fps remote control navigation, and never exceed the strict webOS process memory budget that triggers silent background termination.
System Architecture
Engineered a low-overhead media player core using vanilla TypeScript and optimized DOM nodes, combined with a custom spatial navigation state machine that calculates directional D-pad vectors in constant time O(1). Integrated a customized HLS buffer pipeline that dynamically adjusts video chunks based on TV memory pressure.
┌─────────────────────────────────────────────────────────────────────────────┐
│ REMOTE CONTROL & INPUT TIER │
│ │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
│ │ Hardware Infrared & Magic Remote Input (Key Codes 37-40, OK, Back) │ │
│ └──────────────────────────────────┬──────────────────────────────────┘ │
└──────────────────────────────────────┼──────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────────────────┐
│ SPATIAL NAVIGATION & FOCUS ENGINE │
│ │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
│ │ Zero-Allocation D-Pad Spatial Navigation Graph │ │
│ │ - 2D Bounding-Box Proximity Matrix (Constant Time O(1)) │ │
│ │ - Virtualized DOM List Recycler (Zero GC Spikes During Fast Scroll)│ │
│ └──────────────────────────────────┬──────────────────────────────────┘ │
└──────────────────────────────────────┼──────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────────────────┐
│ STREAMING & MEDIA BUFFER PIPELINE │
│ │
│ ┌───────────────────────────────┐ ┌───────────────────────────────┐ │
│ │ Adaptive HLS/DASH Buffer Mgr │ │ Memory Pressure Watchdog │ │
│ │ - Dynamic Chunk Throttling │◄────┤ - webOS Low-Memory Event Hook│ │
│ │ - Low-Latency Segment Prefetch│ │ - Automatic Buffer Truncation│ │
│ └──────────────┬────────────────┘ └───────────────────────────────┘ │
└──────────────────┼──────────────────────────────────────────────────────────┘
│ Direct Native Media Bridge
▼
┌─────────────────────────────────────────────────────────────────────────────┐
│ LG webOS HARDWARE DECODER SURFACE │
│ │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
│ │ Native Video Hole / Hardware Video Pipeline (HEVC / H.264 / AAC) │ │
│ │ - Hardware Accelerated Compositing & Audio Sink Sync │ │
│ └─────────────────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────────────┘Processes remote control keycodes, executes directional 2D coordinate searches, and manages UI element active states
Recycles DOM elements to present thousands of TV channels and VOD posters without instantiating unbounded HTML nodes
Handles HLS/M3U8 parsing, tokenized stream security, adaptive bitrate ladder selection, and buffer cleanup
Listens to platform lowMemory warnings, triggers immediate texture cache purges, and communicates with webOS SDK
Engineering Decisions
Virtual DOM Recycling instead of React Heavy Virtualizers
React's synthetic event system and reconciliation loop create hundreds of transient objects per second during rapid D-pad holding, inducing garbage collection micro-stutters.
Required writing a direct, lightweight DOM node pool in TypeScript, but eliminated GC pauses and maintained locked 60fps scrolling.
Dynamic Buffer Sizing Based on TV Memory Status
Default video players maintain 30 to 60 seconds of forward video buffer. On a TV with only 120MB free heap, this causes instant out-of-memory crashes.
Restricted the forward buffer to 8–12 seconds on low-tier models while maintaining an adaptive re-fetch window to prevent stalling during network jitter.
CSS transform3d Hardware Acceleration
All UI movements and focus rings utilize GPU composited layers (`transform: translate3d(x, y, 0)`) rather than CPU-rendered `top/left` properties.
Careful management of GPU layer textures to prevent exceeding VRAM capacity.
Technical Challenges & Solutions
Garbage Collection Freezes During Fast Scroll
Holding down the remote control arrow key generated dozens of key events per second, causing standard event handlers to choke the single JavaScript thread.
Decoupled input polling from rendering using an event throttle keyed to `requestAnimationFrame`, updating only coordinate transforms instead of recreating elements.
Silent OS Kill on Memory Spikes
When the TV OS allocates memory for incoming system overlays or notifications, background applications exceeding heap limits are killed without crash logs.
Subscribed to webOS Luna system events for memory warnings, immediately discarding offscreen poster caches and truncating forward video buffers to 4 seconds.
Technology Stack
- • LG webOS 4.0 - 24+
- • webOS TV SDK
- • Luna Bus
- • TypeScript
- • Modern ES6+
- • HTML5 Video Surface
- • HLS (HTTP Live Streaming)
- • MPEG-DASH
- • MSE APIs
- • Chrome DevTools Remote Inspector
- • Memory Heap Snapshots
Key Implementation Highlights
- Zero-dependency spatial navigation library engineered specifically for 4-way D-pad hardware controllers
- Custom M3U8 stream parser capable of processing 10,000+ line channel playlists in under 120ms
- Graceful audio-video recovery system preventing black screens during CDN stream reconnects
Production Screenshots & System Interface
High-resolution interface evidence, operational telemetry cockpits, and field runtime screens.

IvPlayer LG webOS Smart TV Production Interface (Actual Device)
Real application capture running on LG webOS television environment, rendering live media streams, category channels, and low-latency buffer control.
webOS Spatial Navigation & Telemetry Layout
Zero-allocation directional navigation graph, adaptive HLS buffer pipeline, and continuous memory heap telemetry under 512MB RAM.
Results & Current State
Running smoothly on consumer LG smart TVs spanning webOS versions 4.0 through 24, delivering responsive streaming without memory leak crashes.
Key Architectural Takeaways
- 01.Software engineering on low-spec hardware requires mechanical sympathy and algorithmic restraint.
- 02.Every memory allocation matters when garbage collection stalls freeze the display thread.
- 03.Building for the living room means designing for a 10-foot UI controlled exclusively by a directional remote.