The job result containing jobId and/or statusUrl from the initial async response
Polling configuration options
The final job status when succeeded
// Template rendering
const renderJob = await AudioVideoClient.templateRender({ source, variations });
const result = await pollAudioVideoJob(renderJob, {
axiosRequestConfig: { headers },
onProgress: (status) => console.log(`Status: ${status.status}`)
});
// Speech generation
const speechJob = await AudioVideoClient.generateSpeech({ text: 'Hello world' });
const speechResult = await pollAudioVideoJob(speechJob, { axiosRequestConfig: { headers } });
// Video reframing
const reframeJob = await AudioVideoClient.generateReframedVideoV2({ input, outputs });
const reframeResult = await pollAudioVideoJob(reframeJob, { axiosRequestConfig: { headers } });
Polls an Audio and Video API async job until completion
This function works with all job types in the Audio and Video API: