APP-2670: add multipart video upload transport (#11222)
This commit is contained in:
@@ -326,6 +326,7 @@ export async function processVideo(
|
||||
did,
|
||||
signal,
|
||||
i18n,
|
||||
onTransport: telemetry.uploadTransport,
|
||||
setProgress: p => {
|
||||
dispatch({type: 'update_progress', progress: p, signal})
|
||||
},
|
||||
@@ -387,7 +388,7 @@ export async function processVideo(
|
||||
telemetry.processingFailed(e)
|
||||
dispatch({
|
||||
type: 'to_error',
|
||||
error: i18n._(msg`Video failed to process`),
|
||||
error: getProcessingErrorMessage(status?.error, i18n),
|
||||
signal,
|
||||
})
|
||||
return // Exit async loop
|
||||
@@ -420,6 +421,19 @@ export async function processVideo(
|
||||
}
|
||||
}
|
||||
|
||||
function getProcessingErrorMessage(error: string | undefined, i18n: I18n) {
|
||||
switch (error) {
|
||||
case 'video_too_long':
|
||||
return i18n._(msg`The selected video is too long.`)
|
||||
case 'bad_aspect_ratio':
|
||||
return i18n._(msg`The selected video has an unsupported aspect ratio.`)
|
||||
case 'unsupported_codec':
|
||||
return i18n._(msg`The selected video uses an unsupported format.`)
|
||||
default:
|
||||
return i18n._(msg`Video failed to process`)
|
||||
}
|
||||
}
|
||||
|
||||
function getCompressErrorMessage(e: unknown, i18n: I18n): string | null {
|
||||
if (e instanceof AbortError) {
|
||||
return null
|
||||
|
||||
Reference in New Issue
Block a user