Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
L
learn-online-pc
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
learn-online-pc
Commits
520322c8
提交
520322c8
authored
2月 19, 2019
作者:
GOD_ZYX
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改最后时长增加随机1000s,socket断线自动重连
上级
c1e2e702
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
31 行增加
和
6 行删除
+31
-6
chapterVideo.vue
client/components/player/chapterVideo/chapterVideo.vue
+14
-0
index.vue
client/components/websocket/index.vue
+17
-6
没有找到文件。
client/components/player/chapterVideo/chapterVideo.vue
浏览文件 @
520322c8
...
@@ -77,6 +77,8 @@ export default {
...
@@ -77,6 +77,8 @@ export default {
},
},
data
()
{
data
()
{
return
{
return
{
initOverVideoCloseHearBeatTime
:
parseInt
(
Math
.
random
()
*
1000
),
overVideoCloseHearBeatTime
:
0
,
// 当视频全部完成时,随机分钟课程完成挂视频时间,关闭计时器,继承上面的时间
state
:
{
state
:
{
pptIndex
:
0
,
// ppt 所在当前位置
pptIndex
:
0
,
// ppt 所在当前位置
pptBoxOnly
:
false
,
// 仅展示ppt框
pptBoxOnly
:
false
,
// 仅展示ppt框
...
@@ -125,6 +127,18 @@ export default {
...
@@ -125,6 +127,18 @@ export default {
}
else
{
}
else
{
this
.
_rProgress
=
_
.
assignIn
({},
this
.
chapterVideo
.
progress
)
this
.
_rProgress
=
_
.
assignIn
({},
this
.
chapterVideo
.
progress
)
}
}
/* 已经播放到最后,定时记录开始,规定时间后关闭计时器 */
if
(
this
.
videoFlash
.
lastTime
===
this
.
_rProgress
.
cpt
&&
this
.
videoFlash
.
lastTime
===
this
.
_rProgress
.
mpt
)
{
/* 根据设定时间关闭计时器 */
if
(
this
.
overVideoCloseHearBeatTime
>
0
)
{
// console.log(this.overVideoCloseHearBeatTime)
let
_t
=
5
// 每次增加 进度时间,跟计时器时间等同
this
.
_rProgress
.
pt
+=
_t
this
.
overVideoCloseHearBeatTime
-=
_t
}
}
else
{
this
.
overVideoCloseHearBeatTime
=
this
.
initOverVideoCloseHearBeatTime
}
}
}
},
5000
)
},
5000
)
},
},
...
...
client/components/websocket/index.vue
浏览文件 @
520322c8
...
@@ -21,10 +21,10 @@ export default {
...
@@ -21,10 +21,10 @@ export default {
methods
:
{
methods
:
{
createSocket
()
{
createSocket
()
{
let
that
=
this
let
that
=
this
let
socket
=
new
WebSocket
(
window
.
location
.
protocol
.
replace
(
/http/gi
,
'ws'
)
+
'//'
+
window
.
location
.
host
)
// eslint-disable-line
let
_
socket
=
new
WebSocket
(
window
.
location
.
protocol
.
replace
(
/http/gi
,
'ws'
)
+
'//'
+
window
.
location
.
host
)
// eslint-disable-line
socket
.
binaryType
=
'arraybuffer'
_
socket
.
binaryType
=
'arraybuffer'
socket
.
onmessage
=
function
(
msg
)
{
_
socket
.
onmessage
=
function
(
msg
)
{
if
(
msg
.
data
instanceof
ArrayBuffer
)
{
if
(
msg
.
data
instanceof
ArrayBuffer
)
{
var
str
=
String
.
fromCharCode
.
apply
(
null
,
new
Uint8Array
(
msg
.
data
))
var
str
=
String
.
fromCharCode
.
apply
(
null
,
new
Uint8Array
(
msg
.
data
))
var
json
=
JSON
.
parse
(
str
)
var
json
=
JSON
.
parse
(
str
)
...
@@ -38,9 +38,20 @@ export default {
...
@@ -38,9 +38,20 @@ export default {
}
}
}
}
}
}
socket
.
onopen
=
function
(
e
)
{
}
_socket
.
onopen
=
function
(
e
)
{
}
socket
.
onclose
=
function
()
{
}
_socket
.
onclose
=
function
(
e
)
{
return
socket
/* Socket连接关闭,则重连 */
if
(
e
.
target
&&
e
.
target
.
readyState
===
2
)
{
socket
=
that
.
createSocket
()
}
}
_socket
.
onerror
=
function
(
e
)
{
/* Socket连接出错,则重连 */
if
(
e
.
target
&&
e
.
target
.
readyState
===
3
)
{
socket
=
that
.
createSocket
()
}
}
return
_socket
},
},
sendData
(
action
,
val
)
{
sendData
(
action
,
val
)
{
let
str
=
''
let
str
=
''
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论