fix: rebase integration with main
- restore native getVideoMetadata via react-native-compressor so draft-restore on native still works after pickVideo.ts removal - widen metadata signatures to File | string to match call sites - mark conversion.cancel() with void to satisfy no-floating-promises - pnpm install for mediabunny
This commit is contained in:
Generated
+23
@@ -570,6 +570,9 @@ importers:
|
||||
lodash.throttle:
|
||||
specifier: ^4.1.1
|
||||
version: 4.1.1
|
||||
mediabunny:
|
||||
specifier: ^1.25.3
|
||||
version: 1.48.1
|
||||
multiformats:
|
||||
specifier: ^13.4.2
|
||||
version: 13.4.2
|
||||
@@ -3494,6 +3497,12 @@ packages:
|
||||
'@types/connect@3.4.38':
|
||||
resolution: {integrity: sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==}
|
||||
|
||||
'@types/dom-mediacapture-transform@0.1.11':
|
||||
resolution: {integrity: sha512-Y2p+nGf1bF2XMttBnsVPHUWzRRZzqUoJAKmiP10b5umnO6DDrWI0BrGDJy1pOHoOULVmGSfFNkQrAlC5dcj6nQ==}
|
||||
|
||||
'@types/dom-webcodecs@0.1.13':
|
||||
resolution: {integrity: sha512-O5hkiFIcjjszPIYyUSyvScyvrBoV3NOEEZx/pMlsu44TKzWNkLVBBxnxJz42in5n3QIolYOcBYFCPZZ0h8SkwQ==}
|
||||
|
||||
'@types/eslint-scope@3.7.7':
|
||||
resolution: {integrity: sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==}
|
||||
|
||||
@@ -6849,6 +6858,9 @@ packages:
|
||||
resolution: {integrity: sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==}
|
||||
engines: {node: '>= 0.6'}
|
||||
|
||||
mediabunny@1.48.1:
|
||||
resolution: {integrity: sha512-a0pSUTFXgk72yHrQ4ydWavWPtCDw6dnKc6XIFmyE96JOdcA/Xlrgp/C0qVus4Csbw8927hCxNTNZZHa7SUrYVA==}
|
||||
|
||||
memfs@3.5.3:
|
||||
resolution: {integrity: sha512-UERzLsxzllchadvbPs5aolHh65ISpKpM+ccLbOJ8/vvpBKmAWf+la7dXFy7Mr0ySHbdHrFv5kGFCUHHe6GFEmw==}
|
||||
engines: {node: '>= 4.0.0'}
|
||||
@@ -12748,6 +12760,12 @@ snapshots:
|
||||
dependencies:
|
||||
'@types/node': 24.12.4
|
||||
|
||||
'@types/dom-mediacapture-transform@0.1.11':
|
||||
dependencies:
|
||||
'@types/dom-webcodecs': 0.1.13
|
||||
|
||||
'@types/dom-webcodecs@0.1.13': {}
|
||||
|
||||
'@types/eslint-scope@3.7.7':
|
||||
dependencies:
|
||||
'@types/eslint': 9.6.1
|
||||
@@ -16664,6 +16682,11 @@ snapshots:
|
||||
|
||||
media-typer@0.3.0: {}
|
||||
|
||||
mediabunny@1.48.1:
|
||||
dependencies:
|
||||
'@types/dom-mediacapture-transform': 0.1.11
|
||||
'@types/dom-webcodecs': 0.1.13
|
||||
|
||||
memfs@3.5.3:
|
||||
dependencies:
|
||||
fs-monkey: 1.1.0
|
||||
|
||||
@@ -249,7 +249,7 @@ async function doCompression(
|
||||
'abort',
|
||||
() => {
|
||||
logger.debug('compress: cancelled')
|
||||
conversion.cancel()
|
||||
void conversion.cancel()
|
||||
},
|
||||
{once: true},
|
||||
)
|
||||
|
||||
@@ -1,7 +1,23 @@
|
||||
import {getVideoMetaData} from 'react-native-compressor'
|
||||
import {type ImagePickerAsset} from 'expo-image-picker'
|
||||
|
||||
export const getVideoMetadata = (_file: File): Promise<ImagePickerAsset> => {
|
||||
throw new Error('getVideoMetadata is web only')
|
||||
import {extToMime} from '#/lib/media/video/util'
|
||||
|
||||
export async function getVideoMetadata(
|
||||
file: File | string,
|
||||
): Promise<ImagePickerAsset> {
|
||||
if (typeof file !== 'string')
|
||||
throw new Error(
|
||||
'getVideoMetadata was passed a File, when on native it should be a uri',
|
||||
)
|
||||
const metadata = await getVideoMetaData(file)
|
||||
return {
|
||||
uri: file,
|
||||
mimeType: extToMime(metadata.extension),
|
||||
width: metadata.width,
|
||||
height: metadata.height,
|
||||
duration: metadata.duration,
|
||||
}
|
||||
}
|
||||
|
||||
export function hasWebCodecs(): boolean {
|
||||
|
||||
@@ -9,7 +9,13 @@ export function hasWebCodecs(): boolean {
|
||||
)
|
||||
}
|
||||
|
||||
export async function getVideoMetadata(file: File): Promise<ImagePickerAsset> {
|
||||
export async function getVideoMetadata(
|
||||
file: File | string,
|
||||
): Promise<ImagePickerAsset> {
|
||||
if (typeof file === 'string')
|
||||
throw new Error(
|
||||
'getVideoMetadata was passed a uri, when on web it should be a File',
|
||||
)
|
||||
const blobUrl = URL.createObjectURL(file)
|
||||
|
||||
logger.debug('metadata: starting', {
|
||||
|
||||
Reference in New Issue
Block a user