New:Microsoft Teams Notifications Are Now Available in Socket.Learn more →
Get Started

@xiboplayer/settings

Package Overview
Dependencies
Maintainers
1
Versions
80
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@xiboplayer/settings

CMS settings management and application for xiboplayer

Source
npmnpm
Version
0.7.17
Version published
Weekly downloads
15
-48.28%
Maintainers
1
Weekly downloads
 
Created
Source

@xiboplayer/settings

CMS display settings management for Xibo players.

Overview

Parses and applies display configuration received from the CMS RegisterDisplay response:

  • Collection interval -- how often to poll the CMS (60s-86400s, default 300s)
  • Display info -- name, resolution (sizeX/sizeY)
  • Stats config -- enable/disable, aggregation mode (Individual/Aggregate)
  • Log level -- remote log verbosity (error, audit, info, debug)
  • XMR config -- WebSocket address and CMS key for real-time commands
  • Download windows -- time-of-day restrictions with overnight crossing support
  • Screenshot config -- interval and quality settings
  • Event-driven -- emits interval-changed and settings-applied on updates

Architecture

CMS RegisterDisplay response
        |
        v
DisplaySettings.applySettings(raw)
  +- Parse all settings (handles both camelCase and PascalCase)
  +- Validate and normalize values
  +- Detect changes (collectInterval)
  +- Emit events
        |
        v
Platform Layer listens to events
  +- 'interval-changed' -> update collection timer
  +- 'settings-applied' -> update UI, screenshot config, etc.

Installation

npm install @xiboplayer/settings

Usage

import { DisplaySettings } from '@xiboplayer/settings';

const settings = new DisplaySettings();

// Apply settings from CMS (RegisterDisplay response)
const { changed, settings: applied } = settings.applySettings(regResult.settings);
console.log('Changed:', changed); // e.g., ['collectInterval']

// Read settings
const interval = settings.getCollectInterval(); // 300 (seconds)
const displayName = settings.getDisplayName();   // 'Lobby Display'
const { width, height } = settings.getDisplaySize(); // { width: 1920, height: 1080 }
const statsOn = settings.isStatsEnabled();        // true/false

// Check download window
if (settings.isInDownloadWindow()) {
  startDownloads();
} else {
  const next = settings.getNextDownloadWindow();
  console.log(`Downloads paused, next window at ${next}`);
}

// Check screenshot timing
if (settings.shouldTakeScreenshot(lastScreenshotDate)) {
  captureScreenshot();
}

// Listen for changes
settings.on('interval-changed', (newInterval) => {
  updateCollectionTimer(newInterval);
});

settings.on('settings-applied', (allSettings, changedKeys) => {
  console.log('Settings updated:', changedKeys);
});

Settings

KeyTypeDefaultDescription
collectIntervalnumber300CMS polling interval (seconds, min 60, max 86400)
displayNamestring'Unknown Display'Human-readable display name
sizeX / sizeYnumber1920 / 1080Display resolution
statsEnabledbooleanfalseEnable proof-of-play tracking
aggregationLevelstring'Individual'Stats mode: 'Individual' or 'Aggregate'
logLevelstring'error'Remote log level
xmrNetworkAddressstringnullXMR network address
xmrWebSocketAddressstringnullXMR WebSocket URL
xmrCmsKeystringnullXMR authentication key
preventSleepbooleantrueKeep screen awake
screenshotIntervalnumber120Seconds between screenshots
downloadStartWindowstringnullDownload window start (HH:MM)
downloadEndWindowstringnullDownload window end (HH:MM)

API Reference

Constructor

new DisplaySettings()

Extends EventEmitter -- supports on(), off(), emit().

Methods

MethodReturnsDescription
applySettings(raw){ changed, settings }Parse and apply CMS settings
getCollectInterval()numberCollection interval in seconds
getDisplayName()stringDisplay name
getDisplaySize(){ width, height }Display resolution
isStatsEnabled()booleanStats enabled flag
getAllSettings()ObjectAll settings (copy)
getSetting(key, default?)anyGet specific setting
isInDownloadWindow()booleanCheck if downloads are allowed now
getNextDownloadWindow()Date | nullNext download window start
shouldTakeScreenshot(last)booleanCheck if screenshot interval elapsed

Events

EventPayloadDescription
interval-changed(seconds)Collection interval changed
settings-applied(settings, changedKeys)Settings applied from CMS

Dependencies

  • @xiboplayer/utils -- EventEmitter, logger

xiboplayer.org · Part of the XiboPlayer SDK

Keywords

xibo

FAQs

Package last updated on 08 Apr 2026

Related posts