Skip to content

Instantly share code, notes, and snippets.

@ethanj
Created October 26, 2018 23:57
Show Gist options
  • Save ethanj/1afa58ee7175b0b18307958081583375 to your computer and use it in GitHub Desktop.
Save ethanj/1afa58ee7175b0b18307958081583375 to your computer and use it in GitHub Desktop.
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