张乾烈
张乾烈
  • 发布:2020-09-09 20:56
  • 更新:2021-01-11 19:20
  • 阅读:1229

video组件 seek(动态获取的值) ,在h5没有问题,但是安卓上出现从0开始播放,云端打包

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

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

HBuilderX类型: 正式

HBuilderX版本号: 2.8.11

手机系统: Android

手机系统版本号: Android 10

手机厂商: 小米

手机机型: K30

页面类型: vue

打包方式: 云端

项目创建方式: HBuilderX

示例代码:

<view class="show-video">
<video id="myVideo" :poster="poster" :src="src" :autoplay="true" @error="videoErrorCallback" enable-danmu
x5-video-player-type="h5-page" x5-video-player-fullscreen="true" x5-video-orientation="portraint"
webkit-playsinline="true" @timeupdate="timeGet" @ended="ended" @pause="pause">
</video>
</view>

getCousesDetails() { //获取课程详情

            var _this = this;  
            comm.http.get({  
                url: '/api/Course/' + this.$data.GetID,  
                isShowLoading: true,  
                success(res) {  
                    console.log("课程详情", res);  

                    _this.nbTitle = res.Entity.SubCourseName;  
                    _this.CourseInfo = res.Entity;  
                    _this.src = comm.getMapFilePath(_this.CourseInfo.Video.Path);  
                    _this.poster = comm.getFullFilePath(_this.CourseInfo.ImgId);  

                    if (res.StudyRecord) {  
                        console.log("上次播放记录", res.StudyRecord.PlayedTime)  
                        uni.showToast(res.StudyRecord)  
                        _this.initialtime = res.StudyRecord.PlayedTime;  
                        _this.seekeek();  

                    }  

                }  

            })  
        },  
        seekeek(){  
            this.videoContext.seek(this.$data.initialtime);  
        },

操作步骤:

getCousesDetails() { //获取课程详情

            var _this = this;  
            comm.http.get({  
                url: '/api/Course/' + this.$data.GetID,  
                isShowLoading: true,  
                success(res) {  
                    console.log("课程详情", res);  

                    _this.nbTitle = res.Entity.SubCourseName;  
                    _this.CourseInfo = res.Entity;  
                    _this.src = comm.getMapFilePath(_this.CourseInfo.Video.Path);  
                    _this.poster = comm.getFullFilePath(_this.CourseInfo.ImgId);  

                    if (res.StudyRecord) {  
                        console.log("上次播放记录", res.StudyRecord.PlayedTime)  
                        uni.showToast(res.StudyRecord)  
                        _this.initialtime = res.StudyRecord.PlayedTime;  
                        _this.seekeek();  

                    }  

                }  

            })  
        },  
        seekeek(){  
            this.videoContext.seek(this.$data.initialtime);  
        },

预期结果:

准确跳转到指定时间

实际结果:

无效,返回到0秒

bug描述:

2020-09-09 20:56 负责人:无 分享
已邀请:
张乾烈

张乾烈 (作者)

调出来了,手机上不支持 seek 方法,错误提示:TypeError: Cannot read property 'seek' of undefined

2***@qq.com

2***@qq.com

您好解决了吗我也遇到了

该问题目前已经被锁定, 无法添加新回复