diff options
author | Chocobozzz <me@florianbigard.com> | 2020-12-09 15:00:02 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-12-09 16:31:42 +0100 |
commit | a800dbf345e856ab790e7b3ab9a97e8c5dfa0a32 (patch) | |
tree | b7f814ee0dae543a6f2937b9ab5154cfeff3e986 /server/lib/peertube-socket.ts | |
parent | 5cac83a78d6ba5212755fafce2ed25f7c74b04e5 (diff) | |
download | PeerTube-a800dbf345e856ab790e7b3ab9a97e8c5dfa0a32.tar.gz PeerTube-a800dbf345e856ab790e7b3ab9a97e8c5dfa0a32.tar.zst PeerTube-a800dbf345e856ab790e7b3ab9a97e8c5dfa0a32.zip |
Live views update
Diffstat (limited to 'server/lib/peertube-socket.ts')
-rw-r--r-- | server/lib/peertube-socket.ts | 13 |
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) |