aboutsummaryrefslogblamecommitdiffhomepage
path: root/shared/models/runners/runner-job-success-body.model.ts
blob: f45336b059e913db03019d82463aa52da2655497 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13












                                                                              
                                 
                               

















                                                  
                                                


                          








                                                                                                                        
export interface RunnerJobSuccessBody {
  runnerToken: string
  jobToken: string

  payload: RunnerJobSuccessPayload
}

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

export type RunnerJobSuccessPayload =
  VODWebVideoTranscodingSuccess |
  VODHLSTranscodingSuccess |
  VODAudioMergeTranscodingSuccess |
  LiveRTMPHLSTranscodingSuccess |
  VideoStudioTranscodingSuccess

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 interface VideoStudioTranscodingSuccess {
  videoFile: Blob | string
}

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
}