[Video] Fix type on web (#5211)
parent
0a61b06580
commit
f1877e44f2
|
@ -1,3 +1,5 @@
|
|||
import {ImagePickerAsset} from 'expo-image-picker'
|
||||
|
||||
import {VideoTooLargeError} from 'lib/media/video/errors'
|
||||
import {CompressedVideo} from './types'
|
||||
|
||||
|
@ -5,13 +7,13 @@ const MAX_VIDEO_SIZE = 1024 * 1024 * 100 // 100MB
|
|||
|
||||
// doesn't actually compress, but throws if >100MB
|
||||
export async function compressVideo(
|
||||
file: string,
|
||||
asset: ImagePickerAsset,
|
||||
_opts?: {
|
||||
signal?: AbortSignal
|
||||
onProgress?: (progress: number) => void
|
||||
},
|
||||
): Promise<CompressedVideo> {
|
||||
const {mimeType, base64} = parseDataUrl(file)
|
||||
const {mimeType, base64} = parseDataUrl(asset.uri)
|
||||
const blob = base64ToBlob(base64, mimeType)
|
||||
const uri = URL.createObjectURL(blob)
|
||||
|
||||
|
|
Loading…
Reference in New Issue