Commit 4cf28a36 by zhanghaozhe

video temp

parent e21d6307
......@@ -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 => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment