Skip to content

Commit 0828d8d

Browse files
zhengyanan1zhengyanan18
andauthored
fix: 修复IOS端H5-选中视频-不触发成功/失败回调 (#16943)
Co-authored-by: zhengyanan18 <[email protected]>
1 parent 565ab79 commit 0828d8d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/taro-h5/src/api/media/video/chooseMedia.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import Taro from '@tarojs/api'
22
import { isMobile } from 'is-mobile'
33

4+
import { getDeviceInfo } from '../../../api/base/system'
45
import { showActionSheet } from '../../../api/ui'
56
import { getParameterError, shouldBeObject } from '../../../utils'
67
import { MethodHandler } from '../../../utils/handler'
@@ -136,6 +137,7 @@ export const chooseMedia = async function (
136137

137138
if (/^video\//.test(res.fileType)) {
138139
// Video
140+
const isIOS = getDeviceInfo().system.toLowerCase().includes('ios')
139141
const video = document.createElement('video')
140142
const reader = new FileReader()
141143
video.crossOrigin = 'Anonymous'
@@ -160,6 +162,7 @@ export const chooseMedia = async function (
160162
resolve(res)
161163
}
162164
video.onerror = e => reject(e)
165+
isIOS && video.load()
163166
})
164167
} else {
165168
// Image

0 commit comments

Comments
 (0)