This commit is contained in:
Samuel Newman
2025-03-06 19:49:51 +00:00
committed by GitHub
parent 8eb1f8f1fc
commit 153fc17676
4 changed files with 18 additions and 12 deletions
+2 -3
View File
@@ -1,10 +1,9 @@
import {ImagePickerAsset} from 'expo-image-picker'
import {VIDEO_MAX_SIZE} from '#/lib/constants'
import {VideoTooLargeError} from '#/lib/media/video/errors'
import {CompressedVideo} from './types'
const MAX_VIDEO_SIZE = 1000 * 1000 * 50 // 50mb
// doesn't actually compress, converts to ArrayBuffer
export async function compressVideo(
asset: ImagePickerAsset,
@@ -17,7 +16,7 @@ export async function compressVideo(
const blob = base64ToBlob(base64, mimeType)
const uri = URL.createObjectURL(blob)
if (blob.size > MAX_VIDEO_SIZE) {
if (blob.size > VIDEO_MAX_SIZE) {
throw new VideoTooLargeError()
}