aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/peertube-socket.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/peertube-socket.ts')
-rw-r--r--server/lib/peertube-socket.ts13
1 files changed, 12 insertions, 1 deletions
diff --git a/server/lib/peertube-socket.ts b/server/lib/peertube-socket.ts
index 5fc5bc20b..e27963e60 100644
--- a/server/lib/peertube-socket.ts
+++ b/server/lib/peertube-socket.ts
@@ -69,7 +69,18 @@ class PeerTubeSocket {
69 const data: LiveVideoEventPayload = { state: video.state } 69 const data: LiveVideoEventPayload = { state: video.state }
70 const type: LiveVideoEventType = 'state-change' 70 const type: LiveVideoEventType = 'state-change'
71 71
72 logger.debug('Sending video live new state notification of %s.', video.url) 72 logger.debug('Sending video live new state notification of %s.', video.url, { state: video.state })
73
74 this.liveVideosNamespace
75 .in(video.id)
76 .emit(type, data)
77 }
78
79 sendVideoViewsUpdate (video: MVideo) {
80 const data: LiveVideoEventPayload = { views: video.views }
81 const type: LiveVideoEventType = 'views-change'
82
83 logger.debug('Sending video live views update notification of %s.', video.url, { views: video.views })
73 84
74 this.liveVideosNamespace 85 this.liveVideosNamespace
75 .in(video.id) 86 .in(video.id)