Commit 4cf28a36 by zhanghaozhe

video temp

parent e21d6307
...@@ -21,6 +21,7 @@ class Video extends Component { ...@@ -21,6 +21,7 @@ class Video extends Component {
player //video player instance player //video player instance
courseID courseID
ws //websocket instance ws //websocket instance
timer
state = { state = {
...@@ -45,17 +46,46 @@ class Video extends Component { ...@@ -45,17 +46,46 @@ class Video extends Component {
}) })
this.getVideoList() this.getVideoList()
this.getDatumCatalog() this.getDatumCatalog()
// this.ws = new WebSocket('ws://process-test.julyedu.com:9501');
/*this.ws = new WebSocket(api['video-record']); this.setupWS()
this.ws.onmessage = event => { // this.setupTimer()
}
sendStudyRecord = () => {
}
setupWS = () => {
this.ws = new WebSocket('ws://process-test.julyedu.com:9501');
this.ws.addEventListener('onmessage', event => {
console.log(event.data); console.log(event.data);
} })
this.ws.onopen = () => { this.ws.addEventListener('open', () => {
console.log('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 { ...@@ -68,12 +98,19 @@ class Video extends Component {
textTrackDisplay: false, textTrackDisplay: false,
posterImage: false, posterImage: false,
errorDisplay: 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.enableTouchActivity()
this.player.on('seeking', function () { this.player.on('seeking', function () {
console.log('seeking'); console.log('seeking');
}) })
console.log(this.player);
} }
componentWillUnmount() { componentWillUnmount() {
...@@ -81,6 +118,8 @@ class Video extends Component { ...@@ -81,6 +118,8 @@ class Video extends Component {
this.player.dispose() this.player.dispose()
} }
clearInterval(this.timer)
this.ws = null
} }
handleClick = index => { 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