<video id="my-video" src="{{currentVideo.file_url}}" @timeupdate="timeupdate" custom-cache="{{false}}" show-center-play-btn="{{false}}" controls @fullscreenchange="fullScreen" @tap.native="testTap"       @play="setPlayStatus"       @pause="setPauseStatus"><cover-image class="return" src="{{imageUrl}}/image/video/return.png" wx:if="{{fullScreen}}" @tap="quitFullScreen"></cover-image><cover-image src="{{teacherInfo.course_img_url}}" wx:if="{{!playing}}"></cover-image><cover-view class="cover-text" wx:if="{{!playing}}"><cover-view class="text">已有{{teacherInfo.course_study}}人学习了该视频</cover-view><!--<cover-view class="button" @tap="playVideo">开始学习</cover-view>--></cover-view><cover-view class="button" @tap="playVideo" wx:if="{{showBtn}}">开始学习</cover-view></video>setPlayStatus() {this.isPlaying = true},setPauseStatus() {this.isPlaying = false},testTap() {// 这个里面才能拿到相应的值this.isPlaying 做处理this.currentTime = Date. now()if (!this.firstTime) {this.firstTime = this.currentTime    setTimeout(() => {this.firstTime = null    }, 350)  }var mul = (this.currentTime - this.firstTime)console.log(mul)if (mul !== 0 && mul < 350) {console.log('进入函数===', this.isPlaying)this.isPlaying ? this.videoContext.pause() : this.videoContext.play()  }return false},小程序

TAG标签: 微信小程序暂停

http://www.xiaochengxub.com/read-100557.html