video的show-center-play-btn的中间播放按钮显示失败?
发布于 7 年前 作者 yang09 2548 次浏览 来自 问答
期望表现:类似微信聊天的视频样式,视频只有一个封面和开始按钮,点击按钮进入全屏,退出全屏时,视频停止
问题:初始化时视频中央的播放按钮有显示,但是播放后退出全屏后,播放按钮不显示了
wxml部分
<view class='chatImg' data-src='{{item.content}}' catchtap='previewVideo' >
  <video id='video{{index}}' src='{{item.content}}' controls="{{(true)}}" show-progress="{{(false)}}" show-fullscreen-btn="{{(false)}}" show-play-btn="{{(false)}}" show-center-play-btn="{{true}}" bindfullscreenchange="videofullscreen"></video>
</view>

js逻辑部分
previewVideo(e){
  var that = this;
  var src = e.currentTarget.dataset.src;
  var id = e.target.id;
  videoContext = wx.createVideoContext(id);
  videoContext.play()
  videoContext.requestFullScreen({
    direction: 0,
  })
},
videofullscreen(e){
  let that = this;
  if (e.detail.fullScreen){
    videoContext.play()
  }else{
    videoContext.stop()
  }
}

1 回复

你好,麻烦具体描述问题流程,提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html

回到顶部