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

41 lines
1.1 KiB
TypeScript

export interface RunnerJobSuccessBody {
runnerToken: string
jobToken: string
payload: RunnerJobSuccessPayload
}
// ---------------------------------------------------------------------------
export type RunnerJobSuccessPayload =
VODWebVideoTranscodingSuccess |
VODHLSTranscodingSuccess |
VODAudioMergeTranscodingSuccess |
LiveRTMPHLSTranscodingSuccess
export interface VODWebVideoTranscodingSuccess {
videoFile: Blob | string
}
export interface VODHLSTranscodingSuccess {
videoFile: Blob | string
resolutionPlaylistFile: Blob | string
}
export interface VODAudioMergeTranscodingSuccess {
videoFile: Blob | string
}
export interface LiveRTMPHLSTranscodingSuccess {
}
export function isWebVideoOrAudioMergeTranscodingPayloadSuccess (
payload: RunnerJobSuccessPayload
): payload is VODHLSTranscodingSuccess | VODAudioMergeTranscodingSuccess {
return !!(payload as VODHLSTranscodingSuccess | VODAudioMergeTranscodingSuccess)?.videoFile
}
export function isHLSTranscodingPayloadSuccess (payload: RunnerJobSuccessPayload): payload is VODHLSTranscodingSuccess {
return !!(payload as VODHLSTranscodingSuccess)?.resolutionPlaylistFile
}