fix camera roll gif selection hanging on ios
selectVideo awaits a duration probe when the picked asset has no duration. react-native-compressor's iOS getVideoMetaData never resolves or rejects for files without a video track, so picking a gif from the camera roll hung before any composer state was dispatched. skip the probe for gifs, matching the existing guard in compressVideo.
This commit is contained in:
@@ -389,9 +389,15 @@ export const ComposePost = ({
|
|||||||
/*
|
/*
|
||||||
* Share-extension deeplinks deliver a video URI without duration, so
|
* Share-extension deeplinks deliver a video URI without duration, so
|
||||||
* probe before we decide whether to compress. The picker and web paste
|
* probe before we decide whether to compress. The picker and web paste
|
||||||
* paths already populate duration upstream.
|
* paths already populate duration upstream. GIFs must skip the probe:
|
||||||
|
* they have no video track, so the iOS prober never resolves or rejects
|
||||||
|
* and the await below would hang forever.
|
||||||
*/
|
*/
|
||||||
if (asset.duration == null && IS_NATIVE) {
|
if (
|
||||||
|
asset.duration == null &&
|
||||||
|
IS_NATIVE &&
|
||||||
|
asset.mimeType !== 'image/gif'
|
||||||
|
) {
|
||||||
try {
|
try {
|
||||||
const probed = await getVideoMetadata(asset.uri)
|
const probed = await getVideoMetadata(asset.uri)
|
||||||
asset = {
|
asset = {
|
||||||
|
|||||||
Reference in New Issue
Block a user