aboutsummaryrefslogtreecommitdiffhomepage
path: root/packages/models/src/runners/runner-job-update-body.model.ts
blob: ed94bbe63084516595a35b3763c4343f6c35f5b7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
export interface RunnerJobUpdateBody {
  runnerToken: string
  jobToken: string

  progress?: number
  payload?: RunnerJobUpdatePayload
}

// ---------------------------------------------------------------------------

export type RunnerJobUpdatePayload = LiveRTMPHLSTranscodingUpdatePayload

export interface LiveRTMPHLSTranscodingUpdatePayload {
  type: 'add-chunk' | 'remove-chunk'

  masterPlaylistFile?: Blob | string

  resolutionPlaylistFilename?: string
  resolutionPlaylistFile?: Blob | string

  videoChunkFilename: string
  videoChunkFile?: Blob | string
}

export function isLiveRTMPHLSTranscodingUpdatePayload (value: RunnerJobUpdatePayload): value is LiveRTMPHLSTranscodingUpdatePayload {
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
  return !!(value as LiveRTMPHLSTranscodingUpdatePayload)?.videoChunkFilename
}