Commit 40c0f52e9586b1575b25c6e96e5dc872db6a1d33

Authored by fengwotao
1 parent 814c00cf

perf(external/Composes): 修复摄像头页面刷新不自动播放问题

1 <template> 1 <template>
2 <div class="go-content-box" :style="{ width: w + 'px', height: h + 'px' }"> 2 <div class="go-content-box" :style="{ width: w + 'px', height: h + 'px' }">
3 - <video id="my-player" ref="videoRef" class="video-js my-video vjs-theme-city vjs-big-play-centered"> 3 + <video id="my-player" ref="videoRef" class="video-js my-video vjs-theme-city vjs-big-play-centered">
4 <source :src="dataset" /> 4 <source :src="dataset" />
5 </video> 5 </video>
6 </div> 6 </div>
@@ -37,6 +37,7 @@ const options: VideoJsPlayerOptions = { @@ -37,6 +37,7 @@ const options: VideoJsPlayerOptions = {
37 autoplay: true, // 是否自动播放 37 autoplay: true, // 是否自动播放
38 fluid: false, // 自适应宽高 38 fluid: false, // 自适应宽高
39 src: dataset?.value, // 要嵌入的视频源的源 URL 39 src: dataset?.value, // 要嵌入的视频源的源 URL
  40 + muted:true,
40 userActions: { 41 userActions: {
41 hotkeys: true 42 hotkeys: true
42 } 43 }
@@ -64,6 +65,9 @@ watch( @@ -64,6 +65,9 @@ watch(
64 props.chartConfig.option.dataset = newData 65 props.chartConfig.option.dataset = newData
65 videoPlayer?.src(newData) 66 videoPlayer?.src(newData)
66 videoPlayer?.play() 67 videoPlayer?.play()
  68 + },
  69 + {
  70 + immediate: true
67 } 71 }
68 ) 72 )
69 </script> 73 </script>