Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/objects/ad-video.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default class AdVideo extends AbstractCrudObject {
throw Error('Invalid Video ID');
}

VideoEncodingStatusChecker.waitUntilReady(
return VideoEncodingStatusChecker.waitUntilReady(
this.getApi(),
this['id'],
interval,
Expand Down
8 changes: 5 additions & 3 deletions src/video-uploader.js
Original file line number Diff line number Diff line change
Expand Up @@ -428,8 +428,8 @@ class VideoEncodingStatusChecker {
let status = null;

while (true) {
status = VideoEncodingStatusChecker.getStatus(api, videoId);
status = status['video_status'];
status = await VideoEncodingStatusChecker.getStatus(api, videoId);
status = status['status']['video_status'];

if (status !== 'processing') {
break;
Expand All @@ -444,13 +444,15 @@ class VideoEncodingStatusChecker {

if (status !== 'ready') {
throw Error(`Video encoding status ${status}`);
}else{
return status
}
}

static getStatus (api: FacebookAdsApi, videoId: Number) {
const result = api.call('GET', [parseInt(videoId)], {fields: 'status'});

return result['status'];
return result;
}
}

Expand Down