@xibosignage/xibo-layout-renderer 1.0.25 → 1.0.27
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/dist/src/Modules/Generators/Generators.d.ts +16 -1
- package/dist/src/Modules/Generators/index.d.ts +1 -1
- package/dist/src/Modules/Layout/Layout.d.ts +1 -0
- package/dist/src/Modules/Media/Media.d.ts +6 -0
- package/dist/src/Modules/Media/VideoMedia.d.ts +5 -1
- package/dist/src/Types/Layout/Layout.types.d.ts +1 -0
- package/dist/src/Types/Media/Media.types.d.ts +5 -1
- package/dist/src/Types/Media/index.d.ts +1 -1
- package/dist/src/Types/Region/Region.types.d.ts +1 -0
- package/dist/src/Types/XLR/XLR.types.d.ts +4 -0
- package/dist/xibo-layout-renderer.cjs.js +821 -439
- package/dist/xibo-layout-renderer.cjs.js.map +1 -1
- package/dist/xibo-layout-renderer.d.ts +38 -3
- package/dist/xibo-layout-renderer.esm.js +820 -439
- package/dist/xibo-layout-renderer.esm.js.map +1 -1
- package/dist/xibo-layout-renderer.js +821 -439
- package/dist/xibo-layout-renderer.min.js +9 -9
- package/dist/xibo-layout-renderer.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -149,6 +149,7 @@ declare class Layout implements ILayout {
|
|
|
149
149
|
resetLayout(): Promise<void>;
|
|
150
150
|
finishAllRegions(): Promise<void[]>;
|
|
151
151
|
removeLayout(caller?: LayoutPlaybackType): void;
|
|
152
|
+
discardLayout(caller?: LayoutPlaybackType): void;
|
|
152
153
|
getXlf(): string;
|
|
153
154
|
isInterrupt(): boolean;
|
|
154
155
|
on<E extends keyof ILayoutEvents>(event: E, callback: ILayoutEvents[E]): nanoevents.Unsubscribe;
|
|
@@ -190,6 +191,8 @@ type IXlrEvents = {
|
|
|
190
191
|
widgetEnd: (widgetId: number) => void;
|
|
191
192
|
widgetError: (widgetId: number) => void;
|
|
192
193
|
adRequest: (sspLayoutIndex: number) => void;
|
|
194
|
+
sspWidgetRequest: (media: IMedia) => void;
|
|
195
|
+
sspWidgetEnd: (impressionUrls: string[], errorUrls: string[], duration: number) => void;
|
|
193
196
|
updateLoop: (inputLayouts: InputLayoutType[]) => void;
|
|
194
197
|
updateOverlays: (overlays: InputLayoutType[]) => void;
|
|
195
198
|
overlayStart: (overlay: ILayout) => void;
|
|
@@ -222,6 +225,7 @@ interface IXlr {
|
|
|
222
225
|
inputLayouts: InputLayoutType[];
|
|
223
226
|
isInterrupted: boolean;
|
|
224
227
|
isLayoutInDOM(containerName: string, layoutId: number): boolean;
|
|
228
|
+
cleanupOrphanedLayouts(keepCurrent?: ILayout | null, keepNext?: ILayout | null): void;
|
|
225
229
|
isSspEnabled: boolean;
|
|
226
230
|
isUpdatingLoop: boolean;
|
|
227
231
|
isUpdatingOverlays: boolean;
|
|
@@ -257,9 +261,13 @@ declare const vjsDefaultOptions: (opts?: any) => any;
|
|
|
257
261
|
interface IVideoMediaHandler {
|
|
258
262
|
player: Player | undefined;
|
|
259
263
|
duration: number;
|
|
264
|
+
init(): void;
|
|
265
|
+
play(): void;
|
|
260
266
|
stop(disposeOnly?: boolean): void;
|
|
261
267
|
}
|
|
268
|
+
declare const reportToPlayerPlatform: ConsumerPlatform[];
|
|
262
269
|
declare function VideoMedia(media: IMedia, xlr: IXlr): {
|
|
270
|
+
player: Player | undefined;
|
|
263
271
|
duration: number;
|
|
264
272
|
init: () => void;
|
|
265
273
|
stop: (disposeOnly?: boolean) => void;
|
|
@@ -277,6 +285,7 @@ declare class Media implements IMedia {
|
|
|
277
285
|
enableStat: boolean;
|
|
278
286
|
fileId: string;
|
|
279
287
|
finished: boolean;
|
|
288
|
+
fromDt: string;
|
|
280
289
|
html: HTMLElement | null;
|
|
281
290
|
id: string;
|
|
282
291
|
idCounter: number;
|
|
@@ -300,6 +309,7 @@ declare class Media implements IMedia {
|
|
|
300
309
|
state: MediaState;
|
|
301
310
|
tempSrc: string;
|
|
302
311
|
timeoutId: ReturnType<typeof setTimeout>;
|
|
312
|
+
toDt: string;
|
|
303
313
|
type: string;
|
|
304
314
|
uri: string;
|
|
305
315
|
url: string | null;
|
|
@@ -307,6 +317,9 @@ declare class Media implements IMedia {
|
|
|
307
317
|
xml: Element | null;
|
|
308
318
|
videoHandler?: IVideoMediaHandler;
|
|
309
319
|
mediaTimer: ReturnType<typeof setInterval> | undefined;
|
|
320
|
+
sspImpressionUrls: string[] | undefined;
|
|
321
|
+
sspErrorUrls: string[] | undefined;
|
|
322
|
+
private isSspWidget;
|
|
310
323
|
private mediaTimeCount;
|
|
311
324
|
private xlr;
|
|
312
325
|
private readonly statsBC;
|
|
@@ -316,6 +329,7 @@ declare class Media implements IMedia {
|
|
|
316
329
|
private on;
|
|
317
330
|
private init;
|
|
318
331
|
run(): void;
|
|
332
|
+
setSspAdUrl(url: string, adMediaType: 'image' | 'video', impressionUrls?: string[], errorUrls?: string[]): void;
|
|
319
333
|
stop(): Promise<void>;
|
|
320
334
|
/**
|
|
321
335
|
* Emits a command from the shell command widget.
|
|
@@ -348,6 +362,7 @@ interface IMedia {
|
|
|
348
362
|
enableStat: boolean;
|
|
349
363
|
fileId: string;
|
|
350
364
|
finished: boolean;
|
|
365
|
+
fromDt: string;
|
|
351
366
|
html: HTMLElement | null;
|
|
352
367
|
id: string;
|
|
353
368
|
idCounter: number;
|
|
@@ -367,12 +382,16 @@ interface IMedia {
|
|
|
367
382
|
region: IRegion;
|
|
368
383
|
render: string;
|
|
369
384
|
run(): void;
|
|
385
|
+
setSspAdUrl(url: string, adMediaType: 'image' | 'video', impressionUrls?: string[], errorUrls?: string[]): void;
|
|
386
|
+
sspImpressionUrls: string[] | undefined;
|
|
387
|
+
sspErrorUrls: string[] | undefined;
|
|
370
388
|
schemaVersion: string;
|
|
371
389
|
singlePlay: boolean;
|
|
372
390
|
state: MediaState;
|
|
373
391
|
stop(): Promise<void>;
|
|
374
392
|
tempSrc: string;
|
|
375
393
|
timeoutId: ReturnType<typeof setTimeout>;
|
|
394
|
+
toDt: string;
|
|
376
395
|
type: string;
|
|
377
396
|
uri: string;
|
|
378
397
|
url: string | null;
|
|
@@ -381,7 +400,6 @@ interface IMedia {
|
|
|
381
400
|
videoHandler?: IVideoMediaHandler;
|
|
382
401
|
mediaTimer: ReturnType<typeof setInterval> | undefined;
|
|
383
402
|
}
|
|
384
|
-
declare const initialMedia: IMedia;
|
|
385
403
|
|
|
386
404
|
interface IRegion {
|
|
387
405
|
complete: boolean;
|
|
@@ -415,6 +433,7 @@ interface IRegion {
|
|
|
415
433
|
};
|
|
416
434
|
playNextMedia(): void;
|
|
417
435
|
playPreviousMedia(): void;
|
|
436
|
+
prepareMedia(media: IMedia): void;
|
|
418
437
|
prepareMediaObjects(): void;
|
|
419
438
|
prepareRegion(): void;
|
|
420
439
|
ready: boolean;
|
|
@@ -530,6 +549,7 @@ interface ILayout {
|
|
|
530
549
|
finishAllRegions(): Promise<void[]>;
|
|
531
550
|
inLoop: boolean;
|
|
532
551
|
removeLayout(caller?: LayoutPlaybackType): void;
|
|
552
|
+
discardLayout(caller?: LayoutPlaybackType): void;
|
|
533
553
|
xlfString: string;
|
|
534
554
|
getXlf(): string;
|
|
535
555
|
ad: any;
|
|
@@ -592,6 +612,17 @@ declare function getAllAttributes(elem: Element): {
|
|
|
592
612
|
* @returns JSON string format of date
|
|
593
613
|
*/
|
|
594
614
|
declare function setExpiry(numDays: number): string;
|
|
615
|
+
/**
|
|
616
|
+
* Check whether a media item is currently within its valid date window.
|
|
617
|
+
* Returns true when the media should be shown, false when it should be skipped.
|
|
618
|
+
*
|
|
619
|
+
* Rules:
|
|
620
|
+
* - Empty / invalid fromDt → treat as "no start restriction"
|
|
621
|
+
* - Empty / invalid toDt → treat as "no expiry"
|
|
622
|
+
* - now < fromDt → not yet active → skip
|
|
623
|
+
* - now > toDt → expired → skip
|
|
624
|
+
*/
|
|
625
|
+
declare function isMediaActive(fromDt: string, toDt: string): boolean;
|
|
595
626
|
/**
|
|
596
627
|
* Check if given layout exists in the loop using layoutId
|
|
597
628
|
* @param layouts Schedule loop unique layouts (uniqueLayouts)
|
|
@@ -608,7 +639,11 @@ declare function prepareVideoMedia(media: IMedia, region: IRegion): void;
|
|
|
608
639
|
declare function prepareImageMedia(media: IMedia, region: IRegion): void;
|
|
609
640
|
declare function prepareAudioMedia(media: IMedia, region: IRegion): void;
|
|
610
641
|
declare function prepareHtmlMedia(media: IMedia, region: IRegion): void;
|
|
611
|
-
declare
|
|
642
|
+
declare enum FaultCodes {
|
|
643
|
+
FaultVideoSource = 2001,
|
|
644
|
+
FaultVideoUnexpected = 2099
|
|
645
|
+
}
|
|
646
|
+
declare function playerReportFault(msg: string, media: IMedia, code?: number): Promise<void>;
|
|
612
647
|
|
|
613
648
|
declare class Region implements IRegion {
|
|
614
649
|
layout: ILayout;
|
|
@@ -761,4 +796,4 @@ type flyTransitionParams = {
|
|
|
761
796
|
};
|
|
762
797
|
declare const flyTransitionKeyframes: (params: flyTransitionParams) => KeyframeOptionsType;
|
|
763
798
|
|
|
764
|
-
export { Action, ActionsWrapper, AudioMedia, ConsumerPlatform, ELayoutState, ELayoutType, type EventEmitter, type EventUnsubscriber, type GetLayoutParamType, type GetLayoutType, type ILayout, type ILayoutEvents, type IMedia, type IMediaEvents, type IRegion, type IRegionEvents, type ISplashScreen, type IVideoMediaHandler, type IXlr, type IXlrEvents, type IXlrPlayback, type InactOptions, type InputLayoutType, type KeyframeOptionsType, LayoutPlaybackType, Media, MediaState, type MediaTypes, type OptionsType, type PrepareLayoutsType, type PreviewSplashElement, Region, type TransitionElementOptions, type TransitionNameType, VideoMedia, audioFileType, capitalizeStr, type compassPoints, composeBgUrlByPlatform, composeMediaUrl, composeResourceUrl, composeResourceUrlByPlatform, composeVideoSource, createMediaElement, XiboLayoutRenderer as default, defaultTrans, defaultVjsOpts, fadeInElem, fadeOutElem, fetchJSON, fetchText, flyInElem, flyOutElem, flyTransitionKeyframes, type flyTransitionParams, getAllAttributes, getDataBlob, getFileExt, getIndexByLayoutId, getLayout, getLayoutIndexByLayoutId, getMediaId, getXlf, hasDefaultOnly, hasSspLayout, initRenderingDOM, initialLayout,
|
|
799
|
+
export { Action, ActionsWrapper, AudioMedia, ConsumerPlatform, ELayoutState, ELayoutType, type EventEmitter, type EventUnsubscriber, FaultCodes, type GetLayoutParamType, type GetLayoutType, type ILayout, type ILayoutEvents, type IMedia, type IMediaEvents, type IRegion, type IRegionEvents, type ISplashScreen, type IVideoMediaHandler, type IXlr, type IXlrEvents, type IXlrPlayback, type InactOptions, type InputLayoutType, type KeyframeOptionsType, LayoutPlaybackType, Media, MediaState, type MediaTypes, type OptionsType, type PrepareLayoutsType, type PreviewSplashElement, Region, type TransitionElementOptions, type TransitionNameType, VideoMedia, audioFileType, capitalizeStr, type compassPoints, composeBgUrlByPlatform, composeMediaUrl, composeResourceUrl, composeResourceUrlByPlatform, composeVideoSource, createMediaElement, XiboLayoutRenderer as default, defaultTrans, defaultVjsOpts, fadeInElem, fadeOutElem, fetchJSON, fetchText, flyInElem, flyOutElem, flyTransitionKeyframes, type flyTransitionParams, getAllAttributes, getDataBlob, getFileExt, getIndexByLayoutId, getLayout, getLayoutIndexByLayoutId, getMediaId, getXlf, hasDefaultOnly, hasSspLayout, initRenderingDOM, initialLayout, initialRegion, initialXlr, isEmpty, isLayoutValid, isMediaActive, nextId, playerReportFault, preloadMediaBlob, prepareAudioMedia, prepareHtmlMedia, prepareImageMedia, prepareVideoMedia, reportToPlayerPlatform, setExpiry, transitionElement, videoFileType, vjsDefaultOptions };
|