@xiboplayer/renderer 0.7.10 → 0.7.12
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/package.json +7 -7
- package/src/layout.js +11 -6
- package/src/renderer-lite.js +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xiboplayer/renderer",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.12",
|
|
4
4
|
"description": "RendererLite - Fast, efficient XLF layout rendering engine",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -11,14 +11,14 @@
|
|
|
11
11
|
"./layout": "./src/layout.js"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"pdfjs-dist": "^
|
|
15
|
-
"@xiboplayer/cache": "0.7.
|
|
16
|
-
"@xiboplayer/schedule": "0.7.
|
|
17
|
-
"@xiboplayer/utils": "0.7.
|
|
14
|
+
"pdfjs-dist": "^5.6.205",
|
|
15
|
+
"@xiboplayer/cache": "0.7.12",
|
|
16
|
+
"@xiboplayer/schedule": "0.7.12",
|
|
17
|
+
"@xiboplayer/utils": "0.7.12"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"jsdom": "^
|
|
21
|
-
"vitest": "^
|
|
20
|
+
"jsdom": "^29.0.1",
|
|
21
|
+
"vitest": "^4.1.2"
|
|
22
22
|
},
|
|
23
23
|
"keywords": [
|
|
24
24
|
"xibo",
|
package/src/layout.js
CHANGED
|
@@ -124,7 +124,7 @@ export class LayoutTranslator {
|
|
|
124
124
|
'currencies', 'stocks', 'twitter', 'global', 'embedded', 'text', 'ticker'];
|
|
125
125
|
if (widgetTypes.some(w => type.includes(w))) {
|
|
126
126
|
// Try to get widget HTML with retry logic for kiosk reliability
|
|
127
|
-
|
|
127
|
+
const retries = 3;
|
|
128
128
|
let lastError = null;
|
|
129
129
|
|
|
130
130
|
for (let attempt = 1; attempt <= retries; attempt++) {
|
|
@@ -472,7 +472,7 @@ ${mediaJS}
|
|
|
472
472
|
let stopFn = 'null';
|
|
473
473
|
|
|
474
474
|
switch (media.type) {
|
|
475
|
-
case 'image':
|
|
475
|
+
case 'image': {
|
|
476
476
|
// Use absolute URL within service worker scope
|
|
477
477
|
const imageSrc = `${window.location.origin}${PLAYER_API}/media/${media.options.uri}`;
|
|
478
478
|
startFn = `() => {
|
|
@@ -494,8 +494,9 @@ ${mediaJS}
|
|
|
494
494
|
}
|
|
495
495
|
}`;
|
|
496
496
|
break;
|
|
497
|
+
}
|
|
497
498
|
|
|
498
|
-
case 'video':
|
|
499
|
+
case 'video': {
|
|
499
500
|
// All videos use cache URL pattern
|
|
500
501
|
// Background-downloaded videos will auto-reload when cache completes
|
|
501
502
|
const videoSrc = `${window.location.origin}${PLAYER_API}/media/${media.options.uri}`;
|
|
@@ -566,6 +567,7 @@ ${mediaJS}
|
|
|
566
567
|
}
|
|
567
568
|
}`;
|
|
568
569
|
break;
|
|
570
|
+
}
|
|
569
571
|
|
|
570
572
|
case 'text':
|
|
571
573
|
case 'ticker':
|
|
@@ -580,7 +582,7 @@ ${mediaJS}
|
|
|
580
582
|
}
|
|
581
583
|
// Fall through to default (handles missing widgetCacheKey as unsupported)
|
|
582
584
|
|
|
583
|
-
case 'audio':
|
|
585
|
+
case 'audio': {
|
|
584
586
|
const audioSrc = `${window.location.origin}${PLAYER_API}/media/${media.options.uri}`;
|
|
585
587
|
const audioId = `audio_${regionId}_${media.id}`;
|
|
586
588
|
const audioLoop = media.options.loop === '1';
|
|
@@ -695,8 +697,9 @@ ${mediaJS}
|
|
|
695
697
|
}
|
|
696
698
|
}`;
|
|
697
699
|
break;
|
|
700
|
+
}
|
|
698
701
|
|
|
699
|
-
case 'pdf':
|
|
702
|
+
case 'pdf': {
|
|
700
703
|
const pdfSrc = `${window.location.origin}${PLAYER_API}/media/${media.options.uri}`;
|
|
701
704
|
const pdfContainerId = `pdf_${regionId}_${media.id}`;
|
|
702
705
|
const pdfDuration = duration; // Total duration for entire PDF
|
|
@@ -883,8 +886,9 @@ ${mediaJS}
|
|
|
883
886
|
}
|
|
884
887
|
}`;
|
|
885
888
|
break;
|
|
889
|
+
}
|
|
886
890
|
|
|
887
|
-
case 'webpage':
|
|
891
|
+
case 'webpage': {
|
|
888
892
|
const url = decodeURIComponent(media.options.uri || '');
|
|
889
893
|
startFn = `() => {
|
|
890
894
|
const region = document.getElementById('region_${regionId}');
|
|
@@ -906,6 +910,7 @@ ${mediaJS}
|
|
|
906
910
|
};
|
|
907
911
|
}`;
|
|
908
912
|
break;
|
|
913
|
+
}
|
|
909
914
|
|
|
910
915
|
default:
|
|
911
916
|
// Widgets (clock, calendar, weather, etc.) - use cache URL pattern in /player/ scope for SW
|
package/src/renderer-lite.js
CHANGED
|
@@ -2303,7 +2303,7 @@ export class RendererLite {
|
|
|
2303
2303
|
}
|
|
2304
2304
|
};
|
|
2305
2305
|
video.addEventListener('ended', onEnded);
|
|
2306
|
-
|
|
2306
|
+
const videoSrc = storedAs ? this._mediaFileUrl(storedAs) : '';
|
|
2307
2307
|
|
|
2308
2308
|
// HLS/DASH streaming support
|
|
2309
2309
|
const isHlsStream = videoSrc.includes('.m3u8');
|
|
@@ -2607,7 +2607,7 @@ export class RendererLite {
|
|
|
2607
2607
|
}
|
|
2608
2608
|
|
|
2609
2609
|
// Direct URL from storedAs filename
|
|
2610
|
-
|
|
2610
|
+
const pdfUrl = widget.options.uri
|
|
2611
2611
|
? this._mediaFileUrl(widget.options.uri)
|
|
2612
2612
|
: '';
|
|
2613
2613
|
|