feat(vap播放组件): 兼容苹果系统自动播放设置
This commit is contained in:
parent
706140b041
commit
e1b2caab8d
@ -101,6 +101,17 @@ function enforceVideoPlaybackAttributes(video, shouldMute) {
|
||||
return
|
||||
}
|
||||
|
||||
// Keep the video in the DOM and renderable for iOS autoplay policy checks.
|
||||
// WebKit may still require a user gesture for videos with `display:none`.
|
||||
video.style.display = 'block'
|
||||
video.style.position = 'fixed'
|
||||
video.style.left = '-9999px'
|
||||
video.style.top = '0'
|
||||
video.style.width = '1px'
|
||||
video.style.height = '1px'
|
||||
video.style.opacity = '0'
|
||||
video.style.pointerEvents = 'none'
|
||||
|
||||
video.playsInline = true
|
||||
video.setAttribute('playsinline', '')
|
||||
video.setAttribute('webkit-playsinline', '')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user