Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mr-julyedu
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
baiguangyao
mr-julyedu
Commits
2434e345
Commit
2434e345
authored
Feb 26, 2020
by
zhanghaozhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
视频播放页去掉record接口
parent
928baf55
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
44 deletions
+0
-44
src/components/video/index.js
+0
-44
No files found.
src/components/video/index.js
View file @
2434e345
...
...
@@ -13,7 +13,6 @@ import { Modal } from "antd-mobile"
import
{
Loading
}
from
'@/common'
import
{
connect
}
from
"react-redux"
import
jsCookie
from
'js-cookie'
import
io
from
'socket.io-client'
import
Single
from
"@/components/detail/single"
;
import
SingleSuccess
from
"../detail/single/singleSuccess"
;
import
'./CustomPlayButton'
...
...
@@ -83,8 +82,6 @@ class Video extends Component {
isCurrentVideoFirstPlay
=
true
WATCHTIME
=
"watch_time"
COUNTSCHEDULE
=
"count_schedule"
RECENTLEARN
=
"recent_learn"
state
=
{
...
...
@@ -136,7 +133,6 @@ class Video extends Component {
this
.
token
=
jsCookie
.
get
(
'token'
)
this
.
getVideoList
()
this
.
getDatumCatalog
()
this
.
setupRecord
()
}
// 直接购买
...
...
@@ -341,40 +337,6 @@ class Video extends Component {
})
}
setupRecord
=
()
=>
{
this
.
recordSocket
=
io
(
API
.
record
,
{
transports
:
[
'websocket'
],
forceNew
:
true
})
// this.recordSocket = io(API.record)
// this.recordSocket.on('seek', time => {
// this.player.currentTime(time)
// })
// 开启定时器 每5秒发送一次学习记录 --删除
this
.
recordTimer
=
setInterval
(()
=>
{
this
.
sendRecord
()
},
5000
)
}
// 发送学习记录
sendRecord
=
()
=>
{
if
(
this
.
recordSocket
&&
this
.
player
)
{
this
.
recordSocket
.
emit
(
'addRecord'
,
this
.
recordUserInfo
())
}
}
// 返回学习记录的数据
recordUserInfo
=
()
=>
{
let
{
uid
}
=
this
.
props
.
user
.
data
return
{
uid
,
course_id
:
this
.
courseID
,
video_id
:
this
.
state
.
videoList
[
this
.
state
.
activeIndex
][
'id'
],
video_time
:
parseInt
(
this
.
player
.
currentTime
()),
plat
:
5
}
}
// 9502 初始化 监听事件
setupWS
=
()
=>
{
this
.
ws
=
new
WebSocket
(
API
[
"process-api"
]);
...
...
@@ -524,9 +486,6 @@ class Video extends Component {
}
})
this
.
player
.
addChild
(
'CustomPlayButtonCover'
)
this
.
player
.
on
(
'ready'
,
()
=>
{
this
.
recordSocket
.
emit
(
'load'
,
this
.
recordUserInfo
())
})
this
.
player
.
on
(
'play'
,
()
=>
{
const
{
videoList
,
activeIndex
,
vCourseId
,
course
=
{}}
=
this
.
state
// 当视频播放时 看是否是第一次播放(初次进入页面 刷新页面 切换视频 都是第一次播放 需要获取上次的播放时间)
...
...
@@ -566,9 +525,6 @@ class Video extends Component {
clearInterval
(
this
.
timer
);
this
.
timer
=
null
;
})
this
.
player
.
on
(
'seeked'
,
()
=>
{
this
.
sendRecord
()
})
}
sendLastRecord
=
()
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment