微信小程序上传视频到服务器太慢,微信小程序视频播放加载很慢

- 当前 Bug 的表现(可附上截图)

- 预期表现

- 复现路径

- 提供一个最简复现 Demo

微信小程序视频播放加载很慢,一直转圈,3分钟后才能播放,而且播放很卡,加了带宽和cdn也没有效果,官方的video组件是不是有bug

let videotime = e.currentTarget.dataset.videotime;

let currProgress = Number((parseInt(videotime) * progress / 100).toFixed(0));

lastTime = currProgress;

//wx.setStorageSync('lastTime', currProgress);

if (progress == 100)

currProgress = 1;

console.log("currProgress:" + currProgress);

that.setData({

videoUrl: src + "?t=" +new Date().getTime(),

initial: currProgress,

selected3: false, //将封面图隐藏

selected4: true, //将视频video打开显示

selected5: false //将轮播图隐藏

videoCtx = wx.createVideoContext('myVideo')

;

//监听视频播放进度

timeUpdate(e) {

let that = this;

//console.log("duration:" + e.detail.duration)

if (fromProgress < 100) {

duration = e.detail.duration;

//var lastTime = wx.getStorageSync('lastTime') || that.data.initial;

currentTime = e.detail.currentTime;

console.log('上次的时间' + lastTime + '现在的时间' + currentTime);

if ((parseInt(currentTime) - parseInt(lastTime)) > 3) {

videoCtx.seek(lastTime);

return false;

} else {

lastTime = currentTime;

//wx.setStorageSync('lastTime', currentTime);

progress = Math.round((currentTime / duration) * 10000) / 100.00;

pgMap.set(lessionid, progress); //将lessionid和进度存到map中

//console.log("progress:" + progress);

}

}

},

//当播放到末尾时触发 ended 事件

playended(e) {

let that = this;

console.log("更新子课程进度:100")

pgMap.set(lessionid, 100);

that.updateLearnItem(); //更新子课程进度

setTimeout(function () {

that.getDetail();

}, 1000)

},