提交 530a7b50 编写于 作者: 郭胜强

fix: 解决video加载相对路径的资源可能出错的问题

上级 a9b167cb
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
:style="{opacity:!start?0.8:1,objectFit:objectFit}" :style="{opacity:!start?0.8:1,objectFit:objectFit}"
:muted="muted" :muted="muted"
:loop="loop" :loop="loop"
:src="src" :src="srcSync"
:poster="poster" :poster="poster"
class="uni-video-video" class="uni-video-video"
webkit-playsinline webkit-playsinline
...@@ -405,6 +405,9 @@ export default { ...@@ -405,6 +405,9 @@ export default {
*/ */
autoHideContorls () { autoHideContorls () {
return this.controlsShow && this.playing && !this.controlsTouching return this.controlsShow && this.playing && !this.controlsTouching
},
srcSync () {
return this.$getRealPath(this.src)
} }
}, },
watch: { watch: {
...@@ -446,7 +449,7 @@ export default { ...@@ -446,7 +449,7 @@ export default {
direction (val) { direction (val) {
this.directionSync = Number(val) this.directionSync = Number(val)
}, },
src (val) { srcSync (val) {
this.playing = false this.playing = false
this.currentTime = 0 this.currentTime = 0
if (val && this.autoplay) { if (val && this.autoplay) {
...@@ -624,7 +627,7 @@ export default { ...@@ -624,7 +627,7 @@ export default {
ball.addEventListener('touchend', touchend) ball.addEventListener('touchend', touchend)
ball.addEventListener('touchcancel', touchend) ball.addEventListener('touchcancel', touchend)
if (String(this.src).length && this.autoplay) { if (String(this.srcSync).length && this.autoplay) {
video.play() video.play()
} }
}, },
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册