From d5b8f2ccc3861733c618ec7388dc9c73c2688e63 Mon Sep 17 00:00:00 2001 From: zhengyanan18 Date: Fri, 29 Nov 2024 14:41:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DIOS=E7=AB=AFH5-?= =?UTF-8?q?=E9=80=89=E4=B8=AD=E8=A7=86=E9=A2=91-=E4=B8=8D=E8=A7=A6?= =?UTF-8?q?=E5=8F=91=E6=88=90=E5=8A=9F/=E5=A4=B1=E8=B4=A5=E5=9B=9E?= =?UTF-8?q?=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-h5/src/api/media/video/chooseMedia.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/taro-h5/src/api/media/video/chooseMedia.ts b/packages/taro-h5/src/api/media/video/chooseMedia.ts index 8810258cf541..698bcbac2bb4 100644 --- a/packages/taro-h5/src/api/media/video/chooseMedia.ts +++ b/packages/taro-h5/src/api/media/video/chooseMedia.ts @@ -1,6 +1,7 @@ import Taro from '@tarojs/api' import { isMobile } from 'is-mobile' +import { getDeviceInfo } from '../../../api/base/system' import { showActionSheet } from '../../../api/ui' import { getParameterError, shouldBeObject } from '../../../utils' import { MethodHandler } from '../../../utils/handler' @@ -136,6 +137,7 @@ export const chooseMedia = async function ( if (/^video\//.test(res.fileType)) { // Video + const isIOS = getDeviceInfo().system.toLowerCase().includes('ios') const video = document.createElement('video') const reader = new FileReader() video.crossOrigin = 'Anonymous' @@ -160,6 +162,7 @@ export const chooseMedia = async function ( resolve(res) } video.onerror = e => reject(e) + isIOS && video.load() }) } else { // Image