bindPickerChange(e) { //改变的事件名
console.log(this.array[e.target.value])
this.index = e.target.value //将数组改变索引赋给定义的index变量
let beishu = this.array[e.target.value]
this.videoContext = uni.createVideoContext('myVideo', this);
this.videoContext.playbackRate(Number(beishu))
},
videoTimeUpdateEvent(e) { // 播放进度改变
// e.detail.currentTime为每次触发时,视频的当前播放时间
// e.detail.currentTime为每次触发时,视频的当前播放时间
this.durationTime= Number(e.detail.currentTime);
this.zong = e.detail.duration
console.log('视频的当前播放时间', e.detail.duration)
console.log('视频的当前播放时间', this.durationTime)
console.log(typeof this.durationTime)
},
// 开始播放
playvideo(){
if(this.hqzong == this.hqdurationTime){
this.hqdurationTime = 0
console.log(12345678944561)
}
this.videoContext = uni.createVideoContext('myVideo', this);
this.videoContext.requestFullScreen({direction: 90});
this.videoContext.play()
this.videoContext.seek(Number(this.hqdurationTime))
this.multiple = true
},
fullscreenchange (e){
let that = this
console.log(e)
if(!e.detail.fullScreen){
// if(e.detail.direction=='vertical'){
this.videoContext = uni.createVideoContext('myVideo', this);
this.videoContext.pause()
this.videoContext.exitFullScreen();
this.multiple = false
that.$u.get("/api/saveHistory", {
topicId: that.topic.id,
number: that.durationTime,
length:that.zong,
}).then(res => {
})
}else{
this.playvideo()
}
},