- <video id="myVideo" :src="videoList[0]" x5-playsinline="" playsinline="" class="myVideo" :custom-cache="false" :muted='muted'
- webkit-playsinline="" :poster="poster" preload="auto" :autoplay='true'>
- </video>
:autoplay='true' 将自动播放打开:muted='muted'并且静音即可
ios想要自动播放生效就必须静音
:poster="poster" 使用poster封面属性 赋值一个路径即可(最好是传视频的时候让后端把视频路径和封面路径一起返回)
poster封面属性即可
- fdBtn() {
- this.muted=false
- let videoContext = wx.createVideoContext('myVideo'); //获取video的dom
- videoContext.requestFullScreen({
- direction: 90
- });
- this.$nextTick(()=>{
- videoContext.play() //视频播放
- })
- },
