小程序双击暂停事件 分别给播放和暂停一种状态处理两种状态下的不同情况...
<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},小程序
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。

