@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
|
@@ -40,6 +40,17 @@ export declare function getAllAttributes(elem: Element): {
|
|
|
40
40
|
* @returns JSON string format of date
|
|
41
41
|
*/
|
|
42
42
|
export declare function setExpiry(numDays: number): string;
|
|
43
|
+
/**
|
|
44
|
+
* Check whether a media item is currently within its valid date window.
|
|
45
|
+
* Returns true when the media should be shown, false when it should be skipped.
|
|
46
|
+
*
|
|
47
|
+
* Rules:
|
|
48
|
+
* - Empty / invalid fromDt → treat as "no start restriction"
|
|
49
|
+
* - Empty / invalid toDt → treat as "no expiry"
|
|
50
|
+
* - now < fromDt → not yet active → skip
|
|
51
|
+
* - now > toDt → expired → skip
|
|
52
|
+
*/
|
|
53
|
+
export declare function isMediaActive(fromDt: string, toDt: string): boolean;
|
|
43
54
|
/**
|
|
44
55
|
* Check if given layout exists in the loop using layoutId
|
|
45
56
|
* @param layouts Schedule loop unique layouts (uniqueLayouts)
|
|
@@ -61,6 +72,10 @@ export declare function prepareVideoMedia(media: IMedia, region: IRegion): void;
|
|
|
61
72
|
export declare function prepareImageMedia(media: IMedia, region: IRegion): void;
|
|
62
73
|
export declare function prepareAudioMedia(media: IMedia, region: IRegion): void;
|
|
63
74
|
export declare function prepareHtmlMedia(media: IMedia, region: IRegion): void;
|
|
64
|
-
export declare
|
|
75
|
+
export declare enum FaultCodes {
|
|
76
|
+
FaultVideoSource = 2001,
|
|
77
|
+
FaultVideoUnexpected = 2099
|
|
78
|
+
}
|
|
79
|
+
export declare function playerReportFault(msg: string, media: IMedia, code?: number): Promise<void>;
|
|
65
80
|
export declare function setLayoutIndex(layout: ILayout | undefined, layoutIndex: number): ILayout | undefined;
|
|
66
81
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { getFileExt, nextId, preloadMediaBlob, getMediaId, fetchJSON, capitalizeStr, audioFileType, videoFileType, setExpiry, composeMediaUrl, fetchText, getDataBlob, composeResourceUrl, composeResourceUrlByPlatform, getIndexByLayoutId, isEmpty, composeBgUrlByPlatform, hasDefaultOnly, isLayoutValid, createMediaElement, playerReportFault, getAllAttributes, prepareAudioMedia, prepareHtmlMedia, prepareImageMedia, prepareVideoMedia, getLayoutIndexByLayoutId, hasSspLayout, type MediaTypes, } from './Generators';
|
|
1
|
+
export { getFileExt, nextId, preloadMediaBlob, getMediaId, fetchJSON, capitalizeStr, audioFileType, videoFileType, setExpiry, composeMediaUrl, fetchText, getDataBlob, composeResourceUrl, composeResourceUrlByPlatform, getIndexByLayoutId, isEmpty, composeBgUrlByPlatform, hasDefaultOnly, isLayoutValid, createMediaElement, playerReportFault, getAllAttributes, prepareAudioMedia, prepareHtmlMedia, prepareImageMedia, prepareVideoMedia, getLayoutIndexByLayoutId, hasSspLayout, isMediaActive, type MediaTypes, FaultCodes, } from './Generators';
|
|
@@ -67,6 +67,7 @@ export default class Layout implements ILayout {
|
|
|
67
67
|
resetLayout(): Promise<void>;
|
|
68
68
|
finishAllRegions(): Promise<void[]>;
|
|
69
69
|
removeLayout(caller?: LayoutPlaybackType): void;
|
|
70
|
+
discardLayout(caller?: LayoutPlaybackType): void;
|
|
70
71
|
getXlf(): string;
|
|
71
72
|
isInterrupt(): boolean;
|
|
72
73
|
on<E extends keyof ILayoutEvents>(event: E, callback: ILayoutEvents[E]): import("nanoevents").Unsubscribe;
|
|
@@ -18,6 +18,7 @@ export declare class Media implements IMedia {
|
|
|
18
18
|
enableStat: boolean;
|
|
19
19
|
fileId: string;
|
|
20
20
|
finished: boolean;
|
|
21
|
+
fromDt: string;
|
|
21
22
|
html: HTMLElement | null;
|
|
22
23
|
id: string;
|
|
23
24
|
idCounter: number;
|
|
@@ -41,6 +42,7 @@ export declare class Media implements IMedia {
|
|
|
41
42
|
state: MediaState;
|
|
42
43
|
tempSrc: string;
|
|
43
44
|
timeoutId: ReturnType<typeof setTimeout>;
|
|
45
|
+
toDt: string;
|
|
44
46
|
type: string;
|
|
45
47
|
uri: string;
|
|
46
48
|
url: string | null;
|
|
@@ -48,6 +50,9 @@ export declare class Media implements IMedia {
|
|
|
48
50
|
xml: Element | null;
|
|
49
51
|
videoHandler?: IVideoMediaHandler;
|
|
50
52
|
mediaTimer: ReturnType<typeof setInterval> | undefined;
|
|
53
|
+
sspImpressionUrls: string[] | undefined;
|
|
54
|
+
sspErrorUrls: string[] | undefined;
|
|
55
|
+
private isSspWidget;
|
|
51
56
|
private mediaTimeCount;
|
|
52
57
|
private xlr;
|
|
53
58
|
private readonly statsBC;
|
|
@@ -57,6 +62,7 @@ export declare class Media implements IMedia {
|
|
|
57
62
|
private on;
|
|
58
63
|
private init;
|
|
59
64
|
run(): void;
|
|
65
|
+
setSspAdUrl(url: string, adMediaType: 'image' | 'video', impressionUrls?: string[], errorUrls?: string[]): void;
|
|
60
66
|
stop(): Promise<void>;
|
|
61
67
|
/**
|
|
62
68
|
* Emits a command from the shell command widget.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Player from "video.js/dist/types/player";
|
|
2
2
|
import { IMedia } from '../../Types/Media';
|
|
3
|
-
import { IXlr } from '../../types';
|
|
3
|
+
import { ConsumerPlatform, IXlr } from '../../types';
|
|
4
4
|
import './media.css';
|
|
5
5
|
export declare function composeVideoSource($media: HTMLVideoElement, media: IMedia): HTMLVideoElement;
|
|
6
6
|
export declare const defaultVjsOpts: {
|
|
@@ -13,9 +13,13 @@ export declare const vjsDefaultOptions: (opts?: any) => any;
|
|
|
13
13
|
export interface IVideoMediaHandler {
|
|
14
14
|
player: Player | undefined;
|
|
15
15
|
duration: number;
|
|
16
|
+
init(): void;
|
|
17
|
+
play(): void;
|
|
16
18
|
stop(disposeOnly?: boolean): void;
|
|
17
19
|
}
|
|
20
|
+
export declare const reportToPlayerPlatform: ConsumerPlatform[];
|
|
18
21
|
export declare function VideoMedia(media: IMedia, xlr: IXlr): {
|
|
22
|
+
player: Player | undefined;
|
|
19
23
|
duration: number;
|
|
20
24
|
init: () => void;
|
|
21
25
|
stop: (disposeOnly?: boolean) => void;
|
|
@@ -22,6 +22,7 @@ export interface IMedia {
|
|
|
22
22
|
enableStat: boolean;
|
|
23
23
|
fileId: string;
|
|
24
24
|
finished: boolean;
|
|
25
|
+
fromDt: string;
|
|
25
26
|
html: HTMLElement | null;
|
|
26
27
|
id: string;
|
|
27
28
|
idCounter: number;
|
|
@@ -41,12 +42,16 @@ export interface IMedia {
|
|
|
41
42
|
region: IRegion;
|
|
42
43
|
render: string;
|
|
43
44
|
run(): void;
|
|
45
|
+
setSspAdUrl(url: string, adMediaType: 'image' | 'video', impressionUrls?: string[], errorUrls?: string[]): void;
|
|
46
|
+
sspImpressionUrls: string[] | undefined;
|
|
47
|
+
sspErrorUrls: string[] | undefined;
|
|
44
48
|
schemaVersion: string;
|
|
45
49
|
singlePlay: boolean;
|
|
46
50
|
state: MediaState;
|
|
47
51
|
stop(): Promise<void>;
|
|
48
52
|
tempSrc: string;
|
|
49
53
|
timeoutId: ReturnType<typeof setTimeout>;
|
|
54
|
+
toDt: string;
|
|
50
55
|
type: string;
|
|
51
56
|
uri: string;
|
|
52
57
|
url: string | null;
|
|
@@ -55,4 +60,3 @@ export interface IMedia {
|
|
|
55
60
|
videoHandler?: IVideoMediaHandler;
|
|
56
61
|
mediaTimer: ReturnType<typeof setInterval> | undefined;
|
|
57
62
|
}
|
|
58
|
-
export declare const initialMedia: IMedia;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export type { IMedia, } from './Media.types';
|
|
2
|
-
export {
|
|
2
|
+
export { MediaState, } from './Media.types';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Emitter, Unsubscribe } from 'nanoevents';
|
|
2
2
|
import { ILayout, InputLayoutType, OptionsType } from '../Layout';
|
|
3
|
+
import { IMedia } from '../Media';
|
|
3
4
|
import { OverlayLayoutManager } from "../../Modules/Layout/OverlayLayoutManager";
|
|
4
5
|
export type PrepareLayoutsType = {
|
|
5
6
|
moveNext?: boolean;
|
|
@@ -17,6 +18,8 @@ export type IXlrEvents = {
|
|
|
17
18
|
widgetEnd: (widgetId: number) => void;
|
|
18
19
|
widgetError: (widgetId: number) => void;
|
|
19
20
|
adRequest: (sspLayoutIndex: number) => void;
|
|
21
|
+
sspWidgetRequest: (media: IMedia) => void;
|
|
22
|
+
sspWidgetEnd: (impressionUrls: string[], errorUrls: string[], duration: number) => void;
|
|
20
23
|
updateLoop: (inputLayouts: InputLayoutType[]) => void;
|
|
21
24
|
updateOverlays: (overlays: InputLayoutType[]) => void;
|
|
22
25
|
overlayStart: (overlay: ILayout) => void;
|
|
@@ -49,6 +52,7 @@ export interface IXlr {
|
|
|
49
52
|
inputLayouts: InputLayoutType[];
|
|
50
53
|
isInterrupted: boolean;
|
|
51
54
|
isLayoutInDOM(containerName: string, layoutId: number): boolean;
|
|
55
|
+
cleanupOrphanedLayouts(keepCurrent?: ILayout | null, keepNext?: ILayout | null): void;
|
|
52
56
|
isSspEnabled: boolean;
|
|
53
57
|
isUpdatingLoop: boolean;
|
|
54
58
|
isUpdatingOverlays: boolean;
|