Commit a30ff222ec73ad0898e92d1c569f72863445d413
1 parent
f7865747
fix(player): 修复分屏页面视频无法自动播放的问题
Showing
1 changed file
with
8 additions
and
3 deletions
web_src/src/components/common/jessibuca.vue
| 1 | <template> | 1 | <template> |
| 2 | <div ref="container" @dblclick="fullscreenSwich" | 2 | <div ref="container" @dblclick="fullscreenSwich" |
| 3 | - style="width:100%;height:100%;background-color: #000000;margin:0 auto;"> | 3 | + style="width:100%;height:100%;background-color: #000000;margin:0 auto;position: relative;"> |
| 4 | <div class="buttons-box" id="buttonsBox"> | 4 | <div class="buttons-box" id="buttonsBox"> |
| 5 | <div class="buttons-box-left"> | 5 | <div class="buttons-box-left"> |
| 6 | <i v-if="!playing" class="iconfont icon-play jessibuca-btn" @click="playBtnClick"></i> | 6 | <i v-if="!playing" class="iconfont icon-play jessibuca-btn" @click="playBtnClick"></i> |
| @@ -60,8 +60,13 @@ export default { | @@ -60,8 +60,13 @@ export default { | ||
| 60 | }) | 60 | }) |
| 61 | }, | 61 | }, |
| 62 | watch: { | 62 | watch: { |
| 63 | - videoUrl(val, _) { | ||
| 64 | - this.play(val); | 63 | + videoUrl: { |
| 64 | + handler(val, _) { | ||
| 65 | + this.$nextTick(() => { | ||
| 66 | + this.play(val); | ||
| 67 | + }) | ||
| 68 | + }, | ||
| 69 | + immediate: true | ||
| 65 | } | 70 | } |
| 66 | }, | 71 | }, |
| 67 | methods: { | 72 | methods: { |