1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-06 03:50:26 +02:00

Live views update

This commit is contained in:
Chocobozzz 2020-12-09 15:00:02 +01:00
parent 5cac83a78d
commit a800dbf345
No known key found for this signature in database
GPG key ID: 583A612D890159BE
9 changed files with 114 additions and 25 deletions

View file

@ -69,7 +69,18 @@ class PeerTubeSocket {
const data: LiveVideoEventPayload = { state: video.state }
const type: LiveVideoEventType = 'state-change'
logger.debug('Sending video live new state notification of %s.', video.url)
logger.debug('Sending video live new state notification of %s.', video.url, { state: video.state })
this.liveVideosNamespace
.in(video.id)
.emit(type, data)
}
sendVideoViewsUpdate (video: MVideo) {
const data: LiveVideoEventPayload = { views: video.views }
const type: LiveVideoEventType = 'views-change'
logger.debug('Sending video live views update notification of %s.', video.url, { views: video.views })
this.liveVideosNamespace
.in(video.id)