Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
L
learn-online-pc
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
learn-online-pc
Commits
242a7c96
提交
242a7c96
authored
5月 05, 2019
作者:
GOD_ZYX
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
上级
75935c53
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
32 行增加
和
25 行删除
+32
-25
chapterVideo.vue
client/components/player/chapterVideo/chapterVideo.vue
+31
-25
courseDetail.vue
client/project/pages/myLearn/courseDetail.vue
+1
-0
没有找到文件。
client/components/player/chapterVideo/chapterVideo.vue
浏览文件 @
242a7c96
...
...
@@ -123,6 +123,8 @@ export default {
destroyed
()
{
window
.
removeEventListener
(
'resize'
,
this
.
resizeVideo
)
this
.
destroyHeartTime
()
/* 在定时器 被销毁时,再次执行 定时器,防止 最后几秒没有 被统计上 */
this
.
hearBeatFunc
(
10000
)
},
watch
:
{
id
:
{
...
...
@@ -273,36 +275,40 @@ export default {
}
return
r
},
/* 计数器内部执行方法 */
hearBeatFunc
(
_time
)
{
if
(
this
.
chapterVideo
&&
this
.
isPlaying
)
{
if
(
this
.
_rProgress
&&
this
.
_rProgress
.
id
)
{
let
_rProgress
=
this
.
_rProgress
let
tempTime
=
this
.
videoFlash
.
lastTime
let
_speed
=
this
.
videoFlash
.
speed
let
_isSeek
=
this
.
videoFlash
.
isSeek
let
_queue
=
this
.
videoFlash
.
queueFrames
/* 拖动进度条,不记录时间 */
if
(
!
_isSeek
)
{
/* 直接给出 增加定时器 循环定时 的每次 执行传输时间 */
_rProgress
.
pt
+=
(
_time
/
1000
)
*
_speed
/* cpt 和 mpt 应该没问题 */
_rProgress
.
cpt
=
tempTime
_rProgress
.
mpt
=
tempTime
>
_rProgress
.
mpt
?
tempTime
:
_rProgress
.
mpt
_rProgress
.
ps
=
_queue
/* 调用接口执行刷新 */
this
.
$emit
(
'updateProgress'
,
this
.
_rProgress
)
}
}
else
{
this
.
_rProgress
=
_
.
assignIn
({},
this
.
chapterVideo
.
progress
)
}
/* 实时监测 - 是否在播放中 */
this
.
isPlaying
=
false
}
},
/* 初始化定时器 */
createHeartTime
(
time
)
{
let
_time
=
time
||
5
000
let
_time
=
time
||
10
000
this
.
destroyHeartTime
()
/* 增加 心跳 记录 视频学习时间 */
this
.
hearBeat
=
setInterval
(()
=>
{
if
(
this
.
chapterVideo
&&
this
.
isPlaying
)
{
if
(
this
.
_rProgress
&&
this
.
_rProgress
.
id
)
{
let
_rProgress
=
this
.
_rProgress
let
tempTime
=
this
.
videoFlash
.
lastTime
let
_speed
=
this
.
videoFlash
.
speed
let
_isSeek
=
this
.
videoFlash
.
isSeek
let
_queue
=
this
.
videoFlash
.
queueFrames
/* 拖动进度条,不记录时间 */
if
(
!
_isSeek
)
{
/* 直接给出 增加定时器 循环定时 的每次 执行传输时间 */
_rProgress
.
pt
+=
(
_time
/
1000
)
*
_speed
/* cpt 和 mpt 应该没问题 */
_rProgress
.
cpt
=
tempTime
_rProgress
.
mpt
=
tempTime
>
_rProgress
.
mpt
?
tempTime
:
_rProgress
.
mpt
_rProgress
.
ps
=
_queue
/* 调用接口执行刷新 */
this
.
$emit
(
'updateProgress'
,
this
.
_rProgress
)
}
}
else
{
this
.
_rProgress
=
_
.
assignIn
({},
this
.
chapterVideo
.
progress
)
}
/* 实时监测 - 是否在播放中 */
this
.
isPlaying
=
false
}
this
.
hearBeatFunc
(
_time
)
},
_time
)
},
/* 消除定时器 */
...
...
client/project/pages/myLearn/courseDetail.vue
浏览文件 @
242a7c96
...
...
@@ -366,6 +366,7 @@ export default {
cAction.courseAction.getCourseAssess(this.cid, this.sid).then(json1 => {
let _courseArr = json.tabs1ChapterList.course
/* 进行一次 对照,将 视频 vid 赋值 */
/* BUG: 如果有某一章 都没有视频时,对照失败,从没有的那一章开始,后面全部没有vid */
for (let i = 0; i < json1.video.length; i++) {
let _tmp = json1.video[i].arr
let _tmp1 = _courseArr[i].chapters
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论