File tree Expand file tree Collapse file tree 3 files changed +23
-0
lines changed
packages/job-worker/src/playout/model Expand file tree Collapse file tree 3 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -176,6 +176,11 @@ export interface PlayoutPartInstanceModel {
176176 * @param time Reported stopped time
177177 */
178178 setReportedStoppedPlayback ( time : Time ) : boolean
179+ /**
180+ * Set the Reported stopped playback time, including still-playing PieceInstances
181+ * @param time Reported stopped time on all available objects
182+ */
183+ setReportedStoppedPlaybackWithPieceInstances ( time : Time ) : boolean
179184
180185 /**
181186 * Set the rank of this PartInstance, to update it's position in the Segment
Original file line number Diff line number Diff line change @@ -432,6 +432,11 @@ export class PlayoutModelImpl extends PlayoutModelReadonlyImpl implements Playou
432432 deactivatePlaylist ( ) : void {
433433 delete this . playlistImpl . activationId
434434
435+ if ( this . currentPartInstance ) {
436+ this . currentPartInstance . setReportedStoppedPlaybackWithPieceInstances ( getCurrentTime ( ) )
437+ this . queuePartInstanceTimingEvent ( this . currentPartInstance . partInstance . _id )
438+ }
439+
435440 this . clearSelectedPartInstances ( )
436441
437442 this . #playlistHasChanged = true
Original file line number Diff line number Diff line change @@ -471,6 +471,19 @@ export class PlayoutPartInstanceModelImpl implements PlayoutPartInstanceModel {
471471 }
472472 return false
473473 }
474+ setReportedStoppedPlaybackWithPieceInstances ( time : number ) : boolean {
475+ if ( ! this . partInstance . timings ?. reportedStartedPlayback ) return false
476+
477+ let setOnAll = this . setReportedStoppedPlayback ( time )
478+
479+ for ( const model of this . pieceInstances ) {
480+ if ( model . pieceInstance . reportedStartedPlayback ) {
481+ setOnAll &&= model . setReportedStoppedPlayback ( time )
482+ }
483+ }
484+
485+ return setOnAll
486+ }
474487
475488 setRank ( rank : number ) : void {
476489 this . #compareAndSetPartValue( '_rank' , rank )
You can’t perform that action at this time.
0 commit comments