@xiboplayer/renderer 0.6.1 → 0.6.3
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 +4 -3
- package/src/index.d.ts +1 -1
- package/src/layout-pool.test.js +1 -14
- package/src/layout.js +6 -0
- package/src/renderer-lite.ic.test.js +203 -0
- package/src/renderer-lite.js +349 -292
- package/src/renderer-lite.overlays.test.js +1 -27
- package/src/renderer-lite.test.js +511 -60
- package/vitest.config.js +9 -0
|
@@ -65,7 +65,7 @@ describe('RendererLite - Overlay Rendering', () => {
|
|
|
65
65
|
},
|
|
66
66
|
container,
|
|
67
67
|
{
|
|
68
|
-
|
|
68
|
+
fileIdToSaveAs: new Map(),
|
|
69
69
|
getWidgetHtml: async (widget) => widget.raw || '<p>Widget HTML</p>'
|
|
70
70
|
}
|
|
71
71
|
);
|
|
@@ -165,32 +165,6 @@ describe('RendererLite - Overlay Rendering', () => {
|
|
|
165
165
|
expect(secondOverlayDiv).toBe(firstOverlayDiv);
|
|
166
166
|
});
|
|
167
167
|
|
|
168
|
-
it('should pre-fetch media URLs for overlay widgets', async () => {
|
|
169
|
-
const getMediaUrl = vi.fn(async (fileId) => `http://test.local/media/${fileId}`);
|
|
170
|
-
|
|
171
|
-
const customRenderer = new RendererLite(
|
|
172
|
-
{ cmsUrl: 'http://test.local', hardwareKey: 'test-key' },
|
|
173
|
-
container,
|
|
174
|
-
{
|
|
175
|
-
getMediaUrl,
|
|
176
|
-
getWidgetHtml: async (widget) => widget.raw
|
|
177
|
-
}
|
|
178
|
-
);
|
|
179
|
-
|
|
180
|
-
const xlfWithMedia = `<?xml version="1.0"?>
|
|
181
|
-
<layout width="1920" height="1080" bgcolor="#000000">
|
|
182
|
-
<region id="1" width="400" height="200" top="0" left="0" zindex="0">
|
|
183
|
-
<media id="10" fileId="555" type="image" duration="10">
|
|
184
|
-
<options><uri>test.jpg</uri></options>
|
|
185
|
-
</media>
|
|
186
|
-
</region>
|
|
187
|
-
</layout>`;
|
|
188
|
-
|
|
189
|
-
await customRenderer.renderOverlay(xlfWithMedia, 300, 10);
|
|
190
|
-
|
|
191
|
-
expect(getMediaUrl).toHaveBeenCalledWith(555);
|
|
192
|
-
});
|
|
193
|
-
|
|
194
168
|
it('should set overlay timer based on duration', async () => {
|
|
195
169
|
vi.useFakeTimers();
|
|
196
170
|
|