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

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

上级 bbf95155
...@@ -101,7 +101,7 @@ const getCurrentChapterDetail = (vid, videoType,callback) => { ...@@ -101,7 +101,7 @@ const getCurrentChapterDetail = (vid, videoType,callback) => {
callback: function (res) { callback: function (res) {
let json = { let json = {
video: { 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 spareSrc: '' // 正式环境时,需要将 contentVideo 中 spareSrc 改成 src
}, },
audio: { audio: {
...@@ -148,7 +148,8 @@ const updateProgress = (obj) => { ...@@ -148,7 +148,8 @@ const updateProgress = (obj) => {
v: obj.vid, v: obj.vid,
_p: obj.pt, // 累计时间 _p: obj.pt, // 累计时间
_m: obj.mpt, // 当前播放最大时间 _m: obj.mpt, // 当前播放最大时间
_c: obj.cpt // 当前播放位置 _c: obj.cpt, // 当前播放位置
ps: obj.ps // 时间点
}, },
callback: function (res) {} callback: function (res) {}
}) })
......
...@@ -529,6 +529,15 @@ Page({ ...@@ -529,6 +529,15 @@ Page({
break 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一次 并 提交一次 */ /* 增加定时器,每过10000ms,把数据存入localStorage一次 并 提交一次 */
...@@ -560,6 +569,7 @@ Page({ ...@@ -560,6 +569,7 @@ Page({
_rProgress.cpt = tempTime _rProgress.cpt = tempTime
_rProgress.mpt = tempTime > _rProgress.mpt ? tempTime : _rProgress.mpt _rProgress.mpt = tempTime > _rProgress.mpt ? tempTime : _rProgress.mpt
ChapterApi.updateProgress(_rProgress) ChapterApi.updateProgress(_rProgress)
this.realTimeProgress.ps = []
} }
}, 10000) }, 10000)
} }
......
{ {
"description": "项目配置文件。", "description": "项目配置文件。",
"setting": { "setting": {
"urlCheck": true, "urlCheck": true,
"es6": true, "es6": true,
"postcss": true, "enhance": false,
"minified": true, "postcss": true,
"newFeature": true "preloadBackgroundData": false,
}, "minified": true,
"compileType": "miniprogram", "newFeature": true,
"libVersion": "2.3.0", "coverView": true,
"appid": "wx944151f4ea4203a4", "nodeModules": false,
"projectname": "learnOnline", "autoAudits": false,
"isGameTourist": false, "showShadowRootInWxmlPanel": true,
"simulatorType": "wechat", "scopeDataCheck": false,
"simulatorPluginLibVersion": {}, "uglifyFileName": false,
"condition": { "checkInvalidKey": true,
"search": { "checkSiteMap": true,
"current": -1, "uploadWithSourceMap": true,
"list": [] "compileHotReLoad": false,
}, "useMultiFrameRuntime": false,
"conversation": { "useApiHook": true,
"current": -1, "babelSetting": {
"list": [] "ignore": [],
}, "disablePlugins": [],
"game": { "outputPath": ""
"currentL": -1, },
"list": [] "useIsolateContext": true,
}, "useCompilerModule": true,
"miniprogram": { "userConfirmedUseCompilerModuleSwitch": false,
"current": -1, "packNpmManually": false,
"list": [] "packNpmRelationList": [],
} "minifyWXSS": true
} },
"compileType": "miniprogram",
"libVersion": "2.12.2",
"appid": "wx944151f4ea4203a4",
"projectname": "learnOnline",
"isGameTourist": false,
"simulatorType": "wechat",
"simulatorPluginLibVersion": {},
"condition": {
"search": {
"list": []
},
"conversation": {
"list": []
},
"game": {
"currentL": -1,
"list": []
},
"miniprogram": {
"list": []
}
}
} }
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论