@xiboplayer/pwa 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +49 -12
- package/package.json +11 -10
package/README.md
CHANGED
|
@@ -1,26 +1,43 @@
|
|
|
1
1
|
# Xibo Player PWA
|
|
2
2
|
|
|
3
|
-
Lightweight PWA Xibo digital signage player built on the `@xiboplayer` SDK.
|
|
3
|
+
Lightweight PWA Xibo digital signage player built on the [`@xiboplayer` SDK](https://github.com/linuxnow/xiboplayer).
|
|
4
4
|
|
|
5
5
|
## CMS Communication
|
|
6
6
|
|
|
7
|
-
- **REST API** (primary) —
|
|
8
|
-
- **XMDS SOAP** (fallback) —
|
|
7
|
+
- **REST API** (primary) — lighter JSON transport with ETag caching (~30% smaller payloads)
|
|
8
|
+
- **XMDS SOAP** (fallback) — standard Xibo player protocol when REST is unavailable
|
|
9
9
|
|
|
10
10
|
## Features
|
|
11
11
|
|
|
12
|
-
- Offline-first
|
|
13
|
-
- XLF layout rendering via RendererLite
|
|
14
|
-
- Campaign scheduling
|
|
15
|
-
- Real-time CMS commands via XMR WebSocket
|
|
16
|
-
- Proof of play
|
|
17
|
-
-
|
|
12
|
+
- **Offline-first** — Service Worker caching with parallel chunk downloads and progressive streaming
|
|
13
|
+
- **XLF layout rendering** — video (MP4/HLS), images, PDF, text/ticker, web pages via RendererLite
|
|
14
|
+
- **Campaign scheduling** — priority-based campaigns, dayparting, interrupts, and overlays
|
|
15
|
+
- **Real-time CMS commands** — collectNow, screenshot, changeLayout, overlayLayout via XMR WebSocket
|
|
16
|
+
- **Proof of play** — per-layout and per-widget duration tracking with stats reporting
|
|
17
|
+
- **Timeline overlay** — toggleable debug overlay showing upcoming schedule (press `D` to toggle)
|
|
18
|
+
- **Screenshots** — html2canvas-based capture for non-Electron browsers, Electron uses `capturePage()`
|
|
19
|
+
- **Keyboard and presenter remote controls** — interactive actions via touch, click, and keyboard
|
|
20
|
+
- **Download overlay** — hover bottom-right corner to see download progress
|
|
21
|
+
- **Screen Wake Lock** — prevents display from sleeping during playback
|
|
22
|
+
- **Configurable log levels** — `DEBUG`, `INFO`, `WARNING`, `ERROR`, `NONE` (via URL param or CMS settings)
|
|
23
|
+
|
|
24
|
+
## Service Worker Architecture
|
|
25
|
+
|
|
26
|
+
The Service Worker (`sw-pwa.js`) provides:
|
|
27
|
+
|
|
28
|
+
- **Progressive streaming** — large media served via chunk streaming with Range request support
|
|
29
|
+
- **BlobCache** — in-memory assembled chunks with LRU eviction for fast video seeking
|
|
30
|
+
- **XLF-driven media resolution** — parses layout XLF to download exactly the media each layout needs
|
|
31
|
+
- **Layout-ordered downloads** — media queued with barriers so the currently-playing layout downloads first
|
|
32
|
+
- **Version-aware activation** — same-version SW update skips activation to preserve in-flight video streams
|
|
33
|
+
- **Adaptive chunk sizing** — adjusts chunk size and concurrency based on device RAM (4GB/8GB+ tiers)
|
|
18
34
|
|
|
19
35
|
## Installation
|
|
20
36
|
|
|
21
|
-
The PWA
|
|
37
|
+
The PWA can be served from:
|
|
22
38
|
|
|
23
|
-
|
|
39
|
+
1. **CMS origin** — deploy `dist/` to a path under the CMS web server (e.g. `https://your-cms.example.com/player/pwa/`) to avoid CORS
|
|
40
|
+
2. **Standalone with proxy** — use `@xiboplayer/proxy` to serve the PWA and proxy CMS requests (used by Electron and Chromium shells)
|
|
24
41
|
|
|
25
42
|
## Development
|
|
26
43
|
|
|
@@ -47,9 +64,29 @@ pnpm run build
|
|
|
47
64
|
pnpm run dev
|
|
48
65
|
```
|
|
49
66
|
|
|
67
|
+
### Link SDK for local development
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
pnpm link ../xiboplayer/packages/{utils,cache,renderer,schedule,xmds,xmr,core,stats,settings}
|
|
71
|
+
```
|
|
72
|
+
|
|
50
73
|
## Testing
|
|
51
74
|
|
|
52
|
-
|
|
75
|
+
### Electron (recommended for development)
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
cd ../xiboplayer-electron && npx electron . --dev --no-kiosk
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Chromium kiosk
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
cd ../xiboplayer-chromium && ./xiboplayer/launch-kiosk.sh --no-kiosk
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Playwright E2E
|
|
88
|
+
|
|
89
|
+
Playwright tests in `playwright-tests/` run against a live CMS with scheduled layouts — not for CI.
|
|
53
90
|
|
|
54
91
|
```bash
|
|
55
92
|
PWA_URL=https://your-cms.example.com/player/pwa/ npx playwright test
|
package/package.json
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xiboplayer/pwa",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Lightweight PWA Xibo Player with RendererLite",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist"
|
|
8
8
|
],
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@xiboplayer/cache": "^0.
|
|
11
|
-
"@xiboplayer/
|
|
12
|
-
"@xiboplayer/
|
|
13
|
-
"@xiboplayer/
|
|
14
|
-
"@xiboplayer/
|
|
15
|
-
"@xiboplayer/
|
|
16
|
-
"@xiboplayer/
|
|
17
|
-
"@xiboplayer/
|
|
18
|
-
"@xiboplayer/
|
|
10
|
+
"@xiboplayer/cache": "^0.3.0",
|
|
11
|
+
"@xiboplayer/sw": "^0.3.0",
|
|
12
|
+
"@xiboplayer/core": "^0.3.0",
|
|
13
|
+
"@xiboplayer/renderer": "^0.3.0",
|
|
14
|
+
"@xiboplayer/schedule": "^0.3.0",
|
|
15
|
+
"@xiboplayer/settings": "^0.3.0",
|
|
16
|
+
"@xiboplayer/stats": "^0.3.0",
|
|
17
|
+
"@xiboplayer/utils": "^0.3.0",
|
|
18
|
+
"@xiboplayer/xmds": "^0.3.0",
|
|
19
|
+
"@xiboplayer/xmr": "^0.3.0",
|
|
19
20
|
"html2canvas": "^1.4.1",
|
|
20
21
|
"nanoevents": "^9.0.0",
|
|
21
22
|
"xml2js": "^0.6.2"
|