方法一:通过获取元素修改属性



  <video id="playVideos" controls width="100%" height="240">
    <source id="playVideosss" :src="playVideoUrl" type="video/mp4">
    </video>
 

//修改src路径代码
    playVideo(url){
      let vdo = document.getElementById("playVideos")
      vdo.src=url;
      vdo.play();
    },

方法二:连同video标签 的src一起改

<div class="zt-video">
				 <video width="100%" :src="JSON.stringify(playerCurrentItme) !== '{}' ? playerCurrentItme.item.videoUrl : '---'" controls>
				   <source :src="JSON.stringify(playerCurrentItme) !== '{}' ? playerCurrentItme.item.videoUrl : '---'" type="video/mp4">
				 </video>
			 </div>
Logo

前往低代码交流专区

更多推荐