1
0
Fork 0
peertube/shared/models/runners/runner-job-update-body.model.ts
Chocobozzz 0c9668f779 Implement remote runner jobs in server
Move ffmpeg functions to @shared
2023-05-09 08:57:34 +02:00

28 lines
862 B
TypeScript

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
}