[Video] Upload errors and UI improvements (#5092)
* surface errors in UI * style progress indicator * remove job status progress * rm log * fix webm ext
This commit is contained in:
parent
f9d736653c
commit
0e1de19903
11 changed files with 155 additions and 60 deletions
|
@ -29,5 +29,6 @@ export async function compressVideo(
|
|||
)
|
||||
|
||||
const info = await getVideoMetaData(compressed)
|
||||
return {uri: compressed, size: info.size}
|
||||
|
||||
return {uri: compressed, size: info.size, mimeType: `video/${info.extension}`}
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ export async function compressVideo(
|
|||
size: blob.size,
|
||||
uri,
|
||||
bytes: await blob.arrayBuffer(),
|
||||
mimeType,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4,3 +4,10 @@ export class VideoTooLargeError extends Error {
|
|||
this.name = 'VideoTooLargeError'
|
||||
}
|
||||
}
|
||||
|
||||
export class ServerError extends Error {
|
||||
constructor(message: string) {
|
||||
super(message)
|
||||
this.name = 'ServerError'
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
export type CompressedVideo = {
|
||||
uri: string
|
||||
mimeType: string
|
||||
size: number
|
||||
// web only, can fall back to uri if missing
|
||||
bytes?: ArrayBuffer
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue