提交 6e58ed02 编写于 作者: Q qiang

fix: 解决 app-v3 video 组件部分情况在 iOS 上无法显示的问题

上级 0bafe1b7
......@@ -29,7 +29,7 @@ const events = [
'pause',
'ended',
'timeupdate',
'fullscreenchange',
'fullscreenchange',
'fullscreenclick',
'waiting',
'error'
......@@ -168,7 +168,14 @@ export default {
this.video && this.video.setStyles(this.position)
}, { deep: true })
this.$watch('hidden', (val) => {
this.video && this.video[val ? 'hide' : 'show']()
const video = this.video
if (video) {
video[val ? 'hide' : 'show']()
// iOS 隐藏状态设置 setStyles 不生效
if (!val) {
video.setStyles(this.position)
}
}
})
events.forEach(key => {
video.addEventListener(key, (data = {}) => {
......@@ -193,9 +200,9 @@ export default {
break
case 'playbackRate':
data = data.rate
break
case 'requestFullScreen':
data = data.direction
break
case 'requestFullScreen':
data = data.direction
break
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册