From 530a7b50270996d4e9ad9781a1e5510268e5ff5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=AD=E8=83=9C=E5=BC=BA?= Date: Thu, 6 Dec 2018 15:39:21 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3video=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E7=9B=B8=E5=AF=B9=E8=B7=AF=E5=BE=84=E7=9A=84=E8=B5=84?= =?UTF-8?q?=E6=BA=90=E5=8F=AF=E8=83=BD=E5=87=BA=E9=94=99=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/platforms/h5/view/components/video/index.vue | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/platforms/h5/view/components/video/index.vue b/src/platforms/h5/view/components/video/index.vue index a9bd55224..c35569482 100644 --- a/src/platforms/h5/view/components/video/index.vue +++ b/src/platforms/h5/view/components/video/index.vue @@ -19,7 +19,7 @@ :style="{opacity:!start?0.8:1,objectFit:objectFit}" :muted="muted" :loop="loop" - :src="src" + :src="srcSync" :poster="poster" class="uni-video-video" webkit-playsinline @@ -405,6 +405,9 @@ export default { */ autoHideContorls () { return this.controlsShow && this.playing && !this.controlsTouching + }, + srcSync () { + return this.$getRealPath(this.src) } }, watch: { @@ -446,7 +449,7 @@ export default { direction (val) { this.directionSync = Number(val) }, - src (val) { + srcSync (val) { this.playing = false this.currentTime = 0 if (val && this.autoplay) { @@ -624,7 +627,7 @@ export default { ball.addEventListener('touchend', touchend) ball.addEventListener('touchcancel', touchend) - if (String(this.src).length && this.autoplay) { + if (String(this.srcSync).length && this.autoplay) { video.play() } }, -- GitLab