Change wire statistics update interval
This commit is contained in:
parent
201ee9813f
commit
734e791045
|
@ -117,14 +117,16 @@ export default {
|
|||
|
||||
torrent.on('upload', bytes => {
|
||||
state.uploaded += bytes
|
||||
updateWireStatistics()
|
||||
})
|
||||
|
||||
torrent.on('wire', wire => {
|
||||
updateWireStatistics()
|
||||
toast.add({ severity: 'info', summary: 'New watcher', detail: 'Someone has joined your screen.', life: 3000 })
|
||||
})
|
||||
|
||||
setInterval(() => {
|
||||
updateWireStatistics()
|
||||
}, 200)
|
||||
|
||||
toast.add({ severity: 'success', summary: 'Video added', detail: `You are now sharing ${video.name}`, life: 5000 })
|
||||
})
|
||||
}
|
||||
|
|
|
@ -105,7 +105,6 @@ export default {
|
|||
const downloadVideo = (infoHash) => {
|
||||
webTorrent.add(infoHash, { announce: trackers }, torrent => {
|
||||
torrent.on('wire', () => {
|
||||
updateWireStatistics()
|
||||
toast.add({ severity: 'info', summary: 'New watcher', detail: 'Someone has joined your screen.', life: 3000 })
|
||||
})
|
||||
|
||||
|
@ -114,7 +113,6 @@ export default {
|
|||
})
|
||||
|
||||
torrent.on('upload', bytes => {
|
||||
updateWireStatistics()
|
||||
})
|
||||
|
||||
torrent.on('download', bytes => {
|
||||
|
@ -124,7 +122,6 @@ export default {
|
|||
}
|
||||
state.downloaded += bytes
|
||||
progress.value = state.downloaded / video.size * 100
|
||||
updateWireStatistics()
|
||||
})
|
||||
})
|
||||
}
|
||||
|
@ -148,6 +145,10 @@ export default {
|
|||
})
|
||||
|
||||
file.renderTo(player.value)
|
||||
|
||||
setInterval(() => {
|
||||
updateWireStatistics()
|
||||
}, 200)
|
||||
}
|
||||
|
||||
const updateWireStatistics = () => {
|
||||
|
|
Loading…
Reference in New Issue