@xiboplayer/renderer 0.5.16 → 0.5.17
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 +3 -3
- package/src/renderer-lite.js +11 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xiboplayer/renderer",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.17",
|
|
4
4
|
"description": "RendererLite - Fast, efficient XLF layout rendering engine",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"nanoevents": "^9.1.0",
|
|
14
14
|
"pdfjs-dist": "^4.10.38",
|
|
15
|
-
"@xiboplayer/
|
|
16
|
-
"@xiboplayer/
|
|
15
|
+
"@xiboplayer/utils": "0.5.17",
|
|
16
|
+
"@xiboplayer/cache": "0.5.17"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"vitest": "^2.0.0",
|
package/src/renderer-lite.js
CHANGED
|
@@ -1766,6 +1766,9 @@ export class RendererLite {
|
|
|
1766
1766
|
return;
|
|
1767
1767
|
}
|
|
1768
1768
|
|
|
1769
|
+
// Don't start next widget if layout has already ended (race with layout timer)
|
|
1770
|
+
if (this.layoutEndEmitted) return;
|
|
1771
|
+
|
|
1769
1772
|
region.currentIndex = nextIndex;
|
|
1770
1773
|
playNext();
|
|
1771
1774
|
}
|
|
@@ -2440,6 +2443,10 @@ export class RendererLite {
|
|
|
2440
2443
|
* @param {number} layoutId - Layout ID
|
|
2441
2444
|
* @returns {Promise<boolean>} true if preload succeeded, false on failure
|
|
2442
2445
|
*/
|
|
2446
|
+
hasPreloadedLayout(layoutId) {
|
|
2447
|
+
return this.layoutPool.has(layoutId);
|
|
2448
|
+
}
|
|
2449
|
+
|
|
2443
2450
|
async preloadLayout(xlfXml, layoutId) {
|
|
2444
2451
|
// Don't preload if already in pool
|
|
2445
2452
|
if (this.layoutPool.has(layoutId)) {
|
|
@@ -2757,8 +2764,10 @@ export class RendererLite {
|
|
|
2757
2764
|
// Wait for widgets to be ready then start layout timer
|
|
2758
2765
|
this.startLayoutTimerWhenReady(layoutId, preloaded.layout);
|
|
2759
2766
|
|
|
2760
|
-
// Schedule next preload
|
|
2761
|
-
this.
|
|
2767
|
+
// Schedule next preload (unless updateLayoutDuration already did it)
|
|
2768
|
+
if (!this.preloadTimer) {
|
|
2769
|
+
this._scheduleNextLayoutPreload(preloaded.layout);
|
|
2770
|
+
}
|
|
2762
2771
|
|
|
2763
2772
|
this.log.info(`Swapped to preloaded layout ${layoutId} (instant transition)`);
|
|
2764
2773
|
}
|