Skip to content

Commit b3e7767

Browse files
author
Mint de Wit
committed
Merge branch 'upstream/chore-add-lsg-playlist-timing' into bbc-release52
2 parents f116019 + 1dfdaad commit b3e7767

File tree

2 files changed

+54
-1
lines changed

2 files changed

+54
-1
lines changed

packages/live-status-gateway/api/schemas/activePlaylist.yaml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,32 @@ $defs:
4646
description: The end of the loop
4747
$ref: '#/$defs/quickLoopMarker'
4848
required: [locked, running]
49-
required: [event, id, name, rundownIds, currentPart, currentSegment, nextPart]
49+
timing:
50+
description: Timing information about the active playlist
51+
type: object
52+
properties:
53+
timingMode:
54+
description: 'Timing mode for the playlist.'
55+
type: string
56+
enum:
57+
- none
58+
- forward-time
59+
- back-time
60+
startedPlayback:
61+
description: Unix timestamp of when the playlist started (milliseconds)
62+
type: number
63+
expectedStart:
64+
description: Unix timestamp of when the playlist is expected to start (milliseconds). Required when the timingMode is set to forward-time.
65+
type: number
66+
expectedDuration:
67+
description: Duration of the playlist in ms
68+
type: number
69+
expectedEnd:
70+
description: Unix timestamp of when the playlist is expected to end (milliseconds) Required when the timingMode is set to back-time.
71+
type: number
72+
required: [timingMode]
73+
additionalProperties: false
74+
required: [event, id, name, rundownIds, currentPart, currentSegment, nextPart, timing]
5075
additionalProperties: false
5176
examples:
5277
- event: activePlaylist
@@ -61,6 +86,10 @@ $defs:
6186
$ref: '#/$defs/part/examples/0'
6287
publicData:
6388
category: 'Evening News'
89+
timing:
90+
timingMode: 'forward-time'
91+
expectedStart: 1728895750727
92+
duration: 180000
6493
partBase:
6594
type: object
6695
properties:

packages/live-status-gateway/src/topics/activePlaylistTopic.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import { DBSegment } from '@sofie-automation/corelib/dist/dataModel/Segment'
2323
import { SegmentHandler } from '../collections/segmentHandler'
2424
import { SegmentsHandler } from '../collections/segmentsHandler'
2525
import { normalizeArray } from '@sofie-automation/corelib/dist/lib'
26+
import { PlaylistTimingType } from '@sofie-automation/blueprints-integration'
2627

2728
const THROTTLE_PERIOD_MS = 100
2829

@@ -68,6 +69,13 @@ export interface ActivePlaylistStatus {
6869
nextPart: PartStatus | null
6970
quickLoop: ActivePlaylistQuickLoopStatus | undefined
7071
publicData: unknown
72+
timing: {
73+
timingMode: PlaylistTimingType
74+
startedPlayback?: number
75+
expectedStart?: number
76+
expectedDuration?: number
77+
expectedEnd?: number
78+
}
7179
}
7280

7381
export class ActivePlaylistTopic
@@ -170,6 +178,19 @@ export class ActivePlaylistTopic
170178
: null,
171179
quickLoop: this.transformQuickLoopStatus(),
172180
publicData: this._activePlaylist.publicData,
181+
timing: {
182+
timingMode: this._activePlaylist.timing.type,
183+
startedPlayback: this._activePlaylist.startedPlayback,
184+
expectedDuration: this._activePlaylist.timing.expectedDuration,
185+
expectedStart:
186+
this._activePlaylist.timing.type !== PlaylistTimingType.None
187+
? this._activePlaylist.timing.expectedStart
188+
: undefined,
189+
expectedEnd:
190+
this._activePlaylist.timing.type !== PlaylistTimingType.None
191+
? this._activePlaylist.timing.expectedEnd
192+
: undefined,
193+
},
173194
})
174195
: literal<ActivePlaylistStatus>({
175196
event: 'activePlaylist',
@@ -181,6 +202,9 @@ export class ActivePlaylistTopic
181202
nextPart: null,
182203
quickLoop: undefined,
183204
publicData: undefined,
205+
timing: {
206+
timingMode: PlaylistTimingType.None,
207+
},
184208
})
185209

186210
this.sendMessage(subscribers, message)

0 commit comments

Comments
 (0)