uniapp video视频倍数

<video id="myVideo" :show-center-play-btn="zhongjian" direction='90' :initial-time="hqdurationTime" @timeupdate="videoTimeUpdateEvent" @play="playvideo" @fullscreenchange="fullscreenchange" :src="topic.video" controls style="width: 100%;height: 100%;border-radius: 20rpx;">

  <!-- <cover-view class="controls-title" v-if="multiple">

  倍数 -->

  <picker @change="bindPickerChange" :range="array" class="controls-title" v-if="multiple">

  <label>倍数:</label>

  <label class="">{{array[index]}}</label>

  </picker>

  <!-- </cover-view> -->

</video>



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()

}

},

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容