提交 f91f9b8e authored 作者: 王鹏飞's avatar 王鹏飞

上传视频进度增加时间点参数

上级 bbf95155
......@@ -101,7 +101,7 @@ const getCurrentChapterDetail = (vid, videoType,callback) => {
callback: function (res) {
let json = {
video: {
src: videoType == 3 ? res.data.video &&res.data.video.LD : res.data.video[0] && res.data.video[0].playurl,
src: videoType == 3 ? res.data.video &&res.data.video.SD : res.data.video[0] && res.data.video[0].playurl,
spareSrc: '' // 正式环境时,需要将 contentVideo 中 spareSrc 改成 src
},
audio: {
......@@ -148,7 +148,8 @@ const updateProgress = (obj) => {
v: obj.vid,
_p: obj.pt, // 累计时间
_m: obj.mpt, // 当前播放最大时间
_c: obj.cpt // 当前播放位置
_c: obj.cpt, // 当前播放位置
ps: obj.ps // 时间点
},
callback: function (res) {}
})
......
......@@ -529,6 +529,15 @@ Page({
break
}
}
// 记录播放时间点,进度上传后会清空
if (!_obj.currentTime) {
return
}
this.realTimeProgress.ps = this.realTimeProgress.ps || []
const hasTimePoint = this.realTimeProgress.ps.includes(_obj.currentTime)
if (!hasTimePoint) {
this.realTimeProgress.ps.push(_obj.currentTime)
}
},
/* 增加定时器,每过10000ms,把数据存入localStorage一次 并 提交一次 */
......@@ -560,6 +569,7 @@ Page({
_rProgress.cpt = tempTime
_rProgress.mpt = tempTime > _rProgress.mpt ? tempTime : _rProgress.mpt
ChapterApi.updateProgress(_rProgress)
this.realTimeProgress.ps = []
}
}, 10000)
}
......
......@@ -3,12 +3,37 @@
"setting": {
"urlCheck": true,
"es6": true,
"enhance": false,
"postcss": true,
"preloadBackgroundData": false,
"minified": true,
"newFeature": true
"newFeature": true,
"coverView": true,
"nodeModules": false,
"autoAudits": false,
"showShadowRootInWxmlPanel": true,
"scopeDataCheck": false,
"uglifyFileName": false,
"checkInvalidKey": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
"compileHotReLoad": false,
"useMultiFrameRuntime": false,
"useApiHook": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
},
"useIsolateContext": true,
"useCompilerModule": true,
"userConfirmedUseCompilerModuleSwitch": false,
"packNpmManually": false,
"packNpmRelationList": [],
"minifyWXSS": true
},
"compileType": "miniprogram",
"libVersion": "2.3.0",
"libVersion": "2.12.2",
"appid": "wx944151f4ea4203a4",
"projectname": "learnOnline",
"isGameTourist": false,
......@@ -16,11 +41,9 @@
"simulatorPluginLibVersion": {},
"condition": {
"search": {
"current": -1,
"list": []
},
"conversation": {
"current": -1,
"list": []
},
"game": {
......@@ -28,7 +51,6 @@
"list": []
},
"miniprogram": {
"current": -1,
"list": []
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论