What is La Urban Radio Player?
La Urban Radio Player is a sophisticated web-based radio streaming application designed to deliver seamless audio experiences for online radio stations. Built with modern web technologies, it provides listeners with an elegant, responsive interface for enjoying live radio streams with real-time song information, synchronized lyrics, and interactive features.Who is it for?
This radio player is perfect for:- Radio Station Owners looking to provide a professional streaming experience on their website
- Web Developers who need a customizable, production-ready radio player solution
- Music Enthusiasts wanting to build an engaging streaming platform for their audience
- Content Creators who operate online radio stations and need reliable playback technology
Key Features
Audio Streaming
- Seamless Playback: Continuous streaming with optimized buffering for both mobile and desktop
- Adaptive Performance: Intelligent device detection with platform-specific optimizations
- CORS-Ready: Configured to handle cross-origin audio streaming
- Volume Control: Smooth volume adjustments with visual feedback and fade effects
Real-Time Song Information
The player integrates with AzuraCast API to display:- Current song title and artist
- Album artwork with smooth transitions
- Elapsed time and total duration
- Upcoming track information
Synchronized Lyrics Display
One of the standout features is the intelligent lyrics synchronization system:The lyrics system automatically fetches and displays time-synced lyrics that overlay on the album cover, creating an immersive listening experience.
- Automatic Fetching: Searches for lyrics when songs change
- Adaptive Delay Compensation:
- Desktop/Android: 1.5 seconds
- iOS (Safari): 4.5 seconds for optimal sync
- Silent Mode: No error messages when lyrics aren’t available
- Mid-Song Join: Syncs perfectly even if you start listening halfway through
Audio Visualization
- Logo Animation: Reacts to bass kicks and frequency changes
- Frequency Analysis: Detects kicks, bass, mids, and highs
- BPM Detection: Estimates tempo and adjusts animations accordingly
- Mobile Fallback: CSS-based animations when Web Audio API isn’t available
Smart Caching System
TheCacheManager class optimizes API calls and data updates:
- Reduces unnecessary API requests
- Detects meaningful changes (song changes, live state)
- Improves performance and reduces server load
Intelligent Logging
Environment-aware logging system that adapts to development vs production:What Problems Does It Solve?
1. Cross-Platform Audio Playback
Different browsers and devices handle audio streaming differently. This player includes:- iOS Safari compatibility with proper user gesture handling
- Mobile buffering optimizations for cellular connections
- CORS configuration for cross-origin audio sources
- Fallback mechanisms when advanced features aren’t supported
2. Real-Time Synchronization
Keeping lyrics and song info synchronized with a live stream is challenging:- Virtual time calculation based on server-reported elapsed time
- Automatic drift correction every 5 seconds
- Stream delay compensation for latency
- Recovery from interruptions (phone calls, Siri, etc.)
3. User Experience Polish
4. Performance Optimization
The player is optimized for efficiency:- Lazy loading of iframe content (chat, song requests)
- GPU-accelerated transforms for smooth animations
- Conditional feature loading based on device capabilities
- Smart polling that only updates when data actually changes
Technology Stack
- Vanilla JavaScript: No framework dependencies for maximum performance
- Web Audio API: Advanced audio analysis and visualization
- Media Session API: Native OS-level playback controls
- LRCLIB API: Automatic lyrics fetching and synchronization
- AzuraCast Integration: Radio automation platform compatibility
Use Cases
Online Radio Station
Perfect for broadcasting urban music, reggaeton, trap, or any genre 24/7:Podcast Player
Can be adapted for podcast streaming with episode information and chapters.DJ Live Streaming
Includes Kick.com live video integration for DJ streaming sessions:Open Source & Customizable
Built with ❤️ by Syntax It, the player is designed to be:- Easily configurable through centralized config objects
- Well-documented with inline comments and separate docs
- Modular architecture with separate files for lyrics, logging, and caching
- Customizable styling through CSS variables and classes
Next Steps
Quick Start
Get the player running in minutes
Configuration
Customize for your radio station
Lyrics System
Deep dive into synchronized lyrics
Modules API
Technical documentation
