Skip to content

Commit

Permalink
[Video] Fix type on web (#5211)
Browse files Browse the repository at this point in the history
  • Loading branch information
haileyok authored Sep 7, 2024
1 parent 0a61b06 commit f1877e4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/lib/media/video/compress.web.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
import {ImagePickerAsset} from 'expo-image-picker'

import {VideoTooLargeError} from 'lib/media/video/errors'
import {CompressedVideo} from './types'

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)

Expand Down

0 comments on commit f1877e4

Please sign in to comment.