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
4cf28a36
Commit
4cf28a36
authored
Jul 29, 2019
by
zhanghaozhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
video temp
parent
e21d6307
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
8 deletions
+47
-8
src/components/video/index.js
+47
-8
No files found.
src/components/video/index.js
View file @
4cf28a36
...
...
@@ -21,6 +21,7 @@ class Video extends Component {
player
//video player instance
courseID
ws
//websocket instance
timer
state
=
{
...
...
@@ -45,17 +46,46 @@ class Video extends Component {
})
this
.
getVideoList
()
this
.
getDatumCatalog
()
// this.ws = new WebSocket('ws://process-test.julyedu.com:9501');
/*this.ws = new WebSocket(api['video-record']);
this.ws.onmessage = event => {
this
.
setupWS
()
// this.setupTimer()
}
sendStudyRecord
=
()
=>
{
}
setupWS
=
()
=>
{
this
.
ws
=
new
WebSocket
(
'ws://process-test.julyedu.com:9501'
);
this
.
ws
.
addEventListener
(
'onmessage'
,
event
=>
{
console
.
log
(
event
.
data
);
}
this.ws.
onopen =
() => {
}
)
this
.
ws
.
addEventListener
(
'open'
,
()
=>
{
console
.
log
(
'open'
);
}*/
})
this
.
ws
.
addEventListener
(
'error'
,
()
=>
{
console
.
log
(
'error'
);
})
this
.
ws
.
addEventListener
(
'close'
,
()
=>
{
console
.
log
(
'close'
);
})
}
sendStudyRecord
=
()
=>
{
sendMessage
=
message
=>
{
if
(
this
.
player
){
}
}
setupTimer
=
()
=>
{
let
count
=
0
this
.
timer
=
setInterval
(()
=>
{
if
(
this
.
player
){
console
.
log
(
this
.
player
);
console
.
log
(
this
.
player
.
paused
());
}
},
1000
)
}
...
...
@@ -68,12 +98,19 @@ class Video extends Component {
textTrackDisplay
:
false
,
posterImage
:
false
,
errorDisplay
:
false
,
playbackRates
:
[
'0.75'
,
'1'
,
'1.5'
,
'2'
]
playbackRates
:
[
'0.75'
,
'1'
,
'1.5'
,
'2'
],
userActions
:
{
doubleClick
:
()
=>
{
// this.player.pause()
console
.
log
(
this
);
}
}
})
this
.
player
.
enableTouchActivity
()
this
.
player
.
on
(
'seeking'
,
function
()
{
console
.
log
(
'seeking'
);
})
console
.
log
(
this
.
player
);
}
componentWillUnmount
()
{
...
...
@@ -81,6 +118,8 @@ class Video extends Component {
this
.
player
.
dispose
()
}
clearInterval
(
this
.
timer
)
this
.
ws
=
null
}
handleClick
=
index
=>
{
...
...
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