@xiboplayer/core
v0.2.0
Published
Xibo Player core orchestration and lifecycle management
Maintainers
Readme
Xibo Player Core (PWA)
Free, open-source Xibo-compatible digital signage player built as a Progressive Web App.
Features
- ✅ Full XMDS v5 protocol support
- ✅ HTTP file downloads with MD5 verification
- ✅ XLF layout translation to HTML
- ✅ Schedule management with priorities
- ✅ Offline caching (Cache API + IndexedDB)
- ✅ Service Worker for offline operation
- ✅ XMR real-time push (WebSocket)
- ✅ Chunked downloads with progressive streaming
- ✅ Statistics and log submission
- ✅ Screenshot capture and submission
- ✅ Layout transitions (fade, fly)
- ✅ Dynamic criteria (dayparting, display properties)
- ✅ Multi-display sync (BroadcastChannel)
Quick Start
npm install
npm run devOpen http://localhost:5173 in your browser.
CORS Issues
If you get "NetworkError when attempting to fetch resource", the CMS is blocking cross-origin requests. Choose one solution:
Option 1: Enable CORS on CMS (recommended)
Add to your CMS web server config:
Apache (/web/.htaccess):
Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Methods "POST, GET, OPTIONS"
Header set Access-Control-Allow-Headers "Content-Type"Nginx:
add_header Access-Control-Allow-Origin *;Option 2: Use the CORS proxy (for testing)
# Terminal 1
CMS_URL=http://your-cms-address npm run proxy
# Terminal 2
npm run devThen in the player setup, use http://localhost:8080 as the CMS address.
Configuration
- Enter your CMS address (e.g.,
https://cms.example.com) - Enter your CMS key (found in CMS Settings → Display Settings)
- Enter a display name
- Click "Connect"
- Authorize the display in your CMS (Displays → Authorize)
- Refresh the setup page
The player will start downloading content and displaying layouts.
How It Works
Collection Cycle (every 15 minutes)
- RegisterDisplay — Authenticate with CMS, get settings
- RequiredFiles — Get list of layouts and media to download
- Download files — HTTP downloads with MD5 verification
- Translate layouts — Convert XLF to HTML
- Schedule — Get layout schedule
- Apply schedule — Show correct layout based on time/priority
- NotifyStatus — Report current status to CMS
Schedule Check (every 1 minute)
Checks if the current time matches a different scheduled layout and switches if needed.
Offline Operation
- All layouts and media are cached locally (Cache API)
- Service Worker intercepts requests and serves from cache
- Player continues working even if CMS is unreachable
Architecture
src/
├── config.js — localStorage configuration
├── xmds.js — SOAP client (RegisterDisplay, RequiredFiles, Schedule, etc.)
├── cache.js — Cache API + IndexedDB manager
├── schedule.js — Schedule parser and priority logic
├── layout.js — XLF→HTML translator
└── main.js — Orchestrator (collection loop, schedule checks)Configuration Storage
All configuration is stored in localStorage:
{
cmsAddress: 'https://cms.example.com',
cmsKey: 'your-cms-key',
displayName: 'My Display',
hardwareKey: 'auto-generated-uuid',
xmrChannel: 'auto-generated-uuid'
}File Cache
Files are cached using two systems:
- Cache API (
xibo-media-v1) — Binary blobs (images, videos, layouts) - IndexedDB (
xibo-player) — File metadata (id, type, md5, size, cachedAt)
Access cached files via /cache/{type}/{id} URLs.
Browser Compatibility
- Chrome/Edge: Full support
- Firefox: Full support
- Safari: Full support (iOS 11.3+)
- Chrome on Android: Full support (can be wrapped in WebView)
- webOS browser: Full support (can be packaged as IPK)
Development
Build for production
npm run buildOutput: dist/ directory with minified bundle.
Preview production build
npm run previewLicense
AGPL-3.0-or-later
