@xibosignage/xibo-layout-renderer 1.0.25 → 1.0.26

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.
@@ -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;
@@ -222,6 +223,7 @@ interface IXlr {
222
223
  inputLayouts: InputLayoutType[];
223
224
  isInterrupted: boolean;
224
225
  isLayoutInDOM(containerName: string, layoutId: number): boolean;
226
+ cleanupOrphanedLayouts(keepCurrent?: ILayout | null, keepNext?: ILayout | null): void;
225
227
  isSspEnabled: boolean;
226
228
  isUpdatingLoop: boolean;
227
229
  isUpdatingOverlays: boolean;
@@ -257,9 +259,13 @@ declare const vjsDefaultOptions: (opts?: any) => any;
257
259
  interface IVideoMediaHandler {
258
260
  player: Player | undefined;
259
261
  duration: number;
262
+ init(): void;
263
+ play(): void;
260
264
  stop(disposeOnly?: boolean): void;
261
265
  }
266
+ declare const reportToPlayerPlatform: ConsumerPlatform[];
262
267
  declare function VideoMedia(media: IMedia, xlr: IXlr): {
268
+ player: Player | undefined;
263
269
  duration: number;
264
270
  init: () => void;
265
271
  stop: (disposeOnly?: boolean) => void;
@@ -277,6 +283,7 @@ declare class Media implements IMedia {
277
283
  enableStat: boolean;
278
284
  fileId: string;
279
285
  finished: boolean;
286
+ fromDt: string;
280
287
  html: HTMLElement | null;
281
288
  id: string;
282
289
  idCounter: number;
@@ -300,6 +307,7 @@ declare class Media implements IMedia {
300
307
  state: MediaState;
301
308
  tempSrc: string;
302
309
  timeoutId: ReturnType<typeof setTimeout>;
310
+ toDt: string;
303
311
  type: string;
304
312
  uri: string;
305
313
  url: string | null;
@@ -348,6 +356,7 @@ interface IMedia {
348
356
  enableStat: boolean;
349
357
  fileId: string;
350
358
  finished: boolean;
359
+ fromDt: string;
351
360
  html: HTMLElement | null;
352
361
  id: string;
353
362
  idCounter: number;
@@ -373,6 +382,7 @@ interface IMedia {
373
382
  stop(): Promise<void>;
374
383
  tempSrc: string;
375
384
  timeoutId: ReturnType<typeof setTimeout>;
385
+ toDt: string;
376
386
  type: string;
377
387
  uri: string;
378
388
  url: string | null;
@@ -381,7 +391,6 @@ interface IMedia {
381
391
  videoHandler?: IVideoMediaHandler;
382
392
  mediaTimer: ReturnType<typeof setInterval> | undefined;
383
393
  }
384
- declare const initialMedia: IMedia;
385
394
 
386
395
  interface IRegion {
387
396
  complete: boolean;
@@ -530,6 +539,7 @@ interface ILayout {
530
539
  finishAllRegions(): Promise<void[]>;
531
540
  inLoop: boolean;
532
541
  removeLayout(caller?: LayoutPlaybackType): void;
542
+ discardLayout(caller?: LayoutPlaybackType): void;
533
543
  xlfString: string;
534
544
  getXlf(): string;
535
545
  ad: any;
@@ -592,6 +602,17 @@ declare function getAllAttributes(elem: Element): {
592
602
  * @returns JSON string format of date
593
603
  */
594
604
  declare function setExpiry(numDays: number): string;
605
+ /**
606
+ * Check whether a media item is currently within its valid date window.
607
+ * Returns true when the media should be shown, false when it should be skipped.
608
+ *
609
+ * Rules:
610
+ * - Empty / invalid fromDt → treat as "no start restriction"
611
+ * - Empty / invalid toDt → treat as "no expiry"
612
+ * - now < fromDt → not yet active → skip
613
+ * - now > toDt → expired → skip
614
+ */
615
+ declare function isMediaActive(fromDt: string, toDt: string): boolean;
595
616
  /**
596
617
  * Check if given layout exists in the loop using layoutId
597
618
  * @param layouts Schedule loop unique layouts (uniqueLayouts)
@@ -608,7 +629,11 @@ declare function prepareVideoMedia(media: IMedia, region: IRegion): void;
608
629
  declare function prepareImageMedia(media: IMedia, region: IRegion): void;
609
630
  declare function prepareAudioMedia(media: IMedia, region: IRegion): void;
610
631
  declare function prepareHtmlMedia(media: IMedia, region: IRegion): void;
611
- declare function playerReportFault(msg: string, media: IMedia): Promise<void>;
632
+ declare enum FaultCodes {
633
+ FaultVideoSource = 2001,
634
+ FaultVideoUnexpected = 2099
635
+ }
636
+ declare function playerReportFault(msg: string, media: IMedia, code?: number): Promise<void>;
612
637
 
613
638
  declare class Region implements IRegion {
614
639
  layout: ILayout;
@@ -761,4 +786,4 @@ type flyTransitionParams = {
761
786
  };
762
787
  declare const flyTransitionKeyframes: (params: flyTransitionParams) => KeyframeOptionsType;
763
788
 
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, initialMedia, initialRegion, initialXlr, isEmpty, isLayoutValid, nextId, playerReportFault, preloadMediaBlob, prepareAudioMedia, prepareHtmlMedia, prepareImageMedia, prepareVideoMedia, setExpiry, transitionElement, videoFileType, vjsDefaultOptions };
789
+ 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 };