android 视频播放指定位置,【报Bug】uniapp 视频api seek方法 在APP中安卓端 无法跳转到指定的位置播放…

  • Post author:
  • Post category:uniapp


产品分类:

uniapp/App

PC开发环境操作系统:

Windows

PC开发环境操作系统版本号:

windows10 专业版

HBuilderX类型:

正式

HBuilderX版本号:

2.9.8

手机系统:

Android

手机系统版本号:

Android 10

手机厂商:

华为

手机机型:

JEF-AN20

页面类型:

vue

nvue编译模式:

fast

打包方式:

云端

项目创建方式:

HBuilderX

示例代码:

export default {

data() {

return {

VideoContext: {},

state: true,

currentTime: 0,

duration: 0,

videoId: ”,

url: ‘http://imgmyqx.ofbei.com/upload1/20201207/5a755bafd1ceee8b93196173e3d9d563.mp4’

}

},

onReady() {

this.videoId = Date.now() + Math.ceil(Math.random()*10000000)+””;

this.VideoContext = uni.createVideoContext(this.videoId);

},

onLoad() {

const info = uni.getSystemInfoSync();

this.width = info.windowWidth+’px’;

this.height = info.windowHeight;

this.VideoContext.seek(18.299);

this.VideoContext.play();

},

methods: {

timeupdate(e) {

console.log(e.detail);

this.duration = e.detail.duration

this.currentTime = e.detail.currentTime

},

pause(e) {

console.log(‘e–pause:’+JSON.stringify(e));

},

fullscreenchange(e) {

console.log(‘e–fullscreenchange:’+JSON.stringify(e));

},

exitFullScreen(e) {

console.log(‘e–exitFullScreen’+JSON.stringify(e));

}

}

}

操作步骤:

云端打包后,观察现象,看是否符合预期。

预期结果:

能够在指定的时间位置播放

实际结果:

不能够在指定的时间位置播放