From 6e58ed02797c719218afe0fde0ba1de2f5d728fd Mon Sep 17 00:00:00 2001 From: qiang Date: Thu, 5 Mar 2020 17:41:40 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=20app-v3=20video=20?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E9=83=A8=E5=88=86=E6=83=85=E5=86=B5=E5=9C=A8?= =?UTF-8?q?=20iOS=20=E4=B8=8A=E6=97=A0=E6=B3=95=E6=98=BE=E7=A4=BA=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app-plus/view/components/video/index.vue | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/platforms/app-plus/view/components/video/index.vue b/src/platforms/app-plus/view/components/video/index.vue index 163d6a8dde..27a23d82ff 100644 --- a/src/platforms/app-plus/view/components/video/index.vue +++ b/src/platforms/app-plus/view/components/video/index.vue @@ -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 } } -- GitLab