Created
October 26, 2018 23:57
-
-
Save ethanj/1afa58ee7175b0b18307958081583375 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async uploadAndProcessVideo(name, video: File, brand) { | |
const params = new HttpParams().set('type', video.type) | |
const [error, uploadSpec] = await to( | |
this.http | |
.post<any>( | |
environment.apiBaseUrl + '/api/v1/videos/initiate_upload', | |
null, | |
{ | |
params, | |
}, | |
) | |
.toPromise(), | |
) | |
if (error) { | |
console.error('initiate_upload error:', error) | |
swal('Error encountered while uploading the video') | |
return | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment