Commit eae3e49f by wangshuo

只要播放就发送时间和进度

parent 0ab97133
......@@ -388,6 +388,7 @@ class Video extends Component {
}, 1000)
}
clearInterval(this.timer)
this.timer = null;
})
this.ws.addEventListener('message', e => {
const data = JSON.parse(e.data);
......@@ -482,7 +483,7 @@ class Video extends Component {
uid: this.props.user.data.uid,
token: this.token,
platform: 5,
position: this.player.currentTime(),
position: parseInt(this.player.currentTime()),
ctype: ctype,
})
}
......@@ -491,6 +492,7 @@ class Video extends Component {
this.count = 0
this.watchSec = 0
clearInterval(this.timer)
this.timer = null;
this.timer = setInterval(() => {
if (this.player && this.player.player()) {
if (this.count === 5) {
......@@ -561,6 +563,7 @@ class Video extends Component {
this.getShareProgressInfo()
}
clearInterval(this.timer);
this.timer = null;
})
this.player.on('seeked', () => {
this.sendRecord()
......@@ -578,6 +581,7 @@ class Video extends Component {
this.player && this.player.dispose()
clearInterval(this.timer)
this.timer = null;
this.ws && this.ws.close()
this.ws = null
......
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