@@ -39,7 +39,7 @@ import { CurrentPartOrSegmentRemaining } from '../RundownView/RundownTiming/Curr
3939import {
4040 OverUnderClockComponent ,
4141 PlannedEndComponent ,
42- TimesSincePlannedEndComponent ,
42+ TimeSincePlannedEndComponent ,
4343 TimeToPlannedEndComponent ,
4444} from '../../lib/Components/CounterComponents'
4545import { AdjustLabelFit } from '../util/AdjustLabelFit'
@@ -351,33 +351,37 @@ function DirectorScreenRender({
351351 // const currentPartOrSegmentCountdown =
352352 // timingDurations.remainingBudgetOnCurrentSegment ?? timingDurations.remainingTimeOnCurrentPart ?? 0
353353
354- const expectedStart = PlaylistTiming . getExpectedStart ( playlist . timing )
355- const expectedEnd = PlaylistTiming . getExpectedEnd ( playlist . timing ) || 0
354+ const expectedStart = PlaylistTiming . getExpectedStart ( playlist . timing ) || 0
355+ const expectedEnd = PlaylistTiming . getExpectedEnd ( playlist . timing )
356+ const expectedDuration = PlaylistTiming . getExpectedDuration ( playlist . timing ) || 0
357+ const now = timingDurations . currentTime ?? getCurrentTime ( )
356358
357359 const overUnderClock = getPlaylistTimingDiff ( playlist , timingDurations ) ?? 0
358360
359361 return (
360362 < div className = "director-screen" >
361363 < div className = "director-screen__top" >
362- < div className = "director-screen__top__planned-end" >
363- < div >
364- < PlannedEndComponent value = { expectedEnd } />
364+ { expectedEnd ? (
365+ < div className = "director-screen__top__planned-end" >
366+ < div >
367+ < PlannedEndComponent value = { expectedEnd } />
368+ </ div >
369+ PLANNED END
365370 </ div >
366- PLANNED END
367- </ div >
368- { expectedEnd - overUnderClock < 0 ? (
371+ ) : null }
372+ { expectedEnd ? (
369373 < div >
370374 < div >
371- < TimeToPlannedEndComponent value = { expectedEnd - overUnderClock } />
375+ < TimeToPlannedEndComponent value = { now - expectedEnd } />
372376 </ div >
373377 < span className = "director-screen__top__planned-to" > TIME TO PLANNED END</ span >
374378 </ div >
375379 ) : (
376380 < div >
377381 < div >
378- < TimesSincePlannedEndComponent value = { expectedEnd - overUnderClock } />
382+ < TimeSincePlannedEndComponent value = { getCurrentTime ( ) - ( expectedStart + expectedDuration ) } />
383+ < span className = "director-screen__top__planned-since" > TIME SINCE PLANNED END</ span >
379384 </ div >
380- < span className = "director-screen__top__planned-since" > TIME SINCE PLANNED END</ span >
381385 </ div >
382386 ) }
383387 < div >
0 commit comments