@xiboplayer/sw
v0.5.13
Published
Service Worker toolkit for chunk streaming and offline caching
Maintainers
Readme
@xiboplayer/sw
Service Worker toolkit for chunk streaming and offline caching.
Overview
Provides Service Worker building blocks for Xibo players:
- Chunk streaming — progressive download with Range request support for large media files
- BlobCache — in-memory cache for assembled chunks with LRU eviction
- Widget HTML serving — intercepts GetResource requests and serves from cache
- Version-aware activation — prevents re-activation of same SW version to preserve in-flight streams
- XLF-driven media resolution — parses layout XLF to determine exactly which media each layout needs, including data widget IDs extracted from media tags without a fileId
- Unclaimed media downloads — media files not claimed by any layout (widget data, non-XLF assets) are enqueued for download instead of being skipped
Installation
npm install @xiboplayer/swFeatures
This package provides the core logic used by the PWA Service Worker (sw-pwa.js). The SW handles:
- Static caching — PWA shell files cached on install
- Media caching — layout media downloaded via parallel chunks
- Range requests — video seeking served from cached chunks
- Download queue — flat queue with barriers for layout-ordered downloads
xiboplayer.org · Part of the XiboPlayer SDK
