@xiboplayer/schedule 0.2.0 → 0.3.1
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/README.md +16 -78
- package/package.json +2 -2
- package/src/index.js +2 -0
package/README.md
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
# @xiboplayer/schedule
|
|
1
|
+
# @xiboplayer/schedule
|
|
2
2
|
|
|
3
|
-
**Campaign scheduling
|
|
3
|
+
**Campaign scheduling with dayparting, interrupts, overlays, and timeline prediction.**
|
|
4
4
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Complete scheduling solution for Xibo digital signage:
|
|
8
8
|
|
|
9
|
-
- **Campaign
|
|
10
|
-
- **Dayparting**
|
|
11
|
-
- **
|
|
12
|
-
- **
|
|
13
|
-
- **
|
|
9
|
+
- **Campaign scheduling** — priority-based campaign rotation with configurable play counts
|
|
10
|
+
- **Dayparting** — weekly time slots with midnight-crossing support
|
|
11
|
+
- **Interrupts** — percentage-based share-of-voice scheduling with even interleaving across the hour
|
|
12
|
+
- **Overlays** — multiple simultaneous overlay layouts with independent scheduling and priority
|
|
13
|
+
- **Geo-fencing** — location-based schedule filtering with criteria evaluation
|
|
14
|
+
- **Timeline prediction** — deterministic future schedule simulation for proactive content preloading
|
|
14
15
|
|
|
15
16
|
## Installation
|
|
16
17
|
|
|
@@ -21,82 +22,19 @@ npm install @xiboplayer/schedule
|
|
|
21
22
|
## Usage
|
|
22
23
|
|
|
23
24
|
```javascript
|
|
24
|
-
import {
|
|
25
|
+
import { Schedule } from '@xiboplayer/schedule';
|
|
25
26
|
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
timezone: 'America/New_York'
|
|
29
|
-
});
|
|
27
|
+
const schedule = new Schedule();
|
|
28
|
+
schedule.update(scheduleXml);
|
|
30
29
|
|
|
31
|
-
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
// Check next scheduled event
|
|
35
|
-
const nextEvent = scheduler.getNextEvent();
|
|
30
|
+
const currentLayouts = schedule.getCurrentLayouts();
|
|
31
|
+
const timeline = schedule.getTimeline(now, now + 3600000); // next hour
|
|
36
32
|
```
|
|
37
33
|
|
|
38
|
-
## Features
|
|
39
|
-
|
|
40
|
-
### Campaign Priority
|
|
41
|
-
|
|
42
|
-
Campaigns ordered by priority (1 = highest):
|
|
43
|
-
1. Interrupt campaigns (override all)
|
|
44
|
-
2. Normal campaigns (scheduled)
|
|
45
|
-
3. Default layout (fallback)
|
|
46
|
-
|
|
47
|
-
### Dayparting
|
|
48
|
-
|
|
49
|
-
Time-based scheduling:
|
|
50
|
-
```javascript
|
|
51
|
-
{
|
|
52
|
-
dayOfWeek: [1, 2, 3, 4, 5], // Mon-Fri
|
|
53
|
-
startTime: '08:00',
|
|
54
|
-
endTime: '18:00'
|
|
55
|
-
}
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
### Geo-Scheduling
|
|
59
|
-
|
|
60
|
-
Location-based content:
|
|
61
|
-
```javascript
|
|
62
|
-
{
|
|
63
|
-
geofence: {
|
|
64
|
-
latitude: 40.7128,
|
|
65
|
-
longitude: -74.0060,
|
|
66
|
-
radius: 1000 // meters
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
## API Reference
|
|
72
|
-
|
|
73
|
-
### Scheduler
|
|
74
|
-
|
|
75
|
-
```javascript
|
|
76
|
-
class Scheduler {
|
|
77
|
-
constructor(options)
|
|
78
|
-
getCurrentLayout()
|
|
79
|
-
getNextEvent()
|
|
80
|
-
setLocation(lat, lon)
|
|
81
|
-
on(event, callback)
|
|
82
|
-
}
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
### Events
|
|
86
|
-
|
|
87
|
-
- `schedule:change` - Active schedule changed
|
|
88
|
-
- `campaign:start` - Campaign started
|
|
89
|
-
- `campaign:end` - Campaign ended
|
|
90
|
-
|
|
91
34
|
## Dependencies
|
|
92
35
|
|
|
93
|
-
- `@xiboplayer/utils`
|
|
94
|
-
|
|
95
|
-
## Related Packages
|
|
96
|
-
|
|
97
|
-
- [@xiboplayer/core](../../core/docs/) - Player orchestration
|
|
36
|
+
- `@xiboplayer/utils` — logger, events
|
|
98
37
|
|
|
99
38
|
---
|
|
100
39
|
|
|
101
|
-
**
|
|
102
|
-
**Last Updated**: 2026-02-10
|
|
40
|
+
**Part of the [XiboPlayer SDK](https://github.com/xibo-players/xiboplayer)** | [MCP Server](https://github.com/xibo-players/xiboplayer/tree/main/mcp-server) for AI-assisted development
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xiboplayer/schedule",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Complete scheduling solution: campaigns, dayparting, interrupts, and overlays",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"./overlays": "./src/overlays.js"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@xiboplayer/utils": "0.
|
|
14
|
+
"@xiboplayer/utils": "0.3.1"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"vitest": "^2.0.0"
|
package/src/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
// @xiboplayer/schedule - Campaign scheduling and advanced features
|
|
2
2
|
// Basic scheduling, interrupts, overlays, and dayparting
|
|
3
|
+
import pkg from '../package.json' with { type: 'json' };
|
|
4
|
+
export const VERSION = pkg.version;
|
|
3
5
|
|
|
4
6
|
/**
|
|
5
7
|
* Core schedule manager for basic scheduling and dayparting
|