]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/core/notification/peertube-socket.service.ts
Live views update
[github/Chocobozzz/PeerTube.git] / client / src / app / core / notification / peertube-socket.service.ts
index 7e1c43364a7d0b1190ae2dfa5a7d9a4b90b197da..089276cfcf7619ca7a15da01dc3046a6454ecfaf 100644 (file)
@@ -73,8 +73,11 @@ export class PeerTubeSocket {
       this.liveVideosSocket = this.io(environment.apiUrl + '/live-videos')
     })
 
-    const type: LiveVideoEventType = 'state-change'
-    this.liveVideosSocket.on(type, (payload: LiveVideoEventPayload) => this.dispatchLiveVideoEvent(type, payload))
+    const types: LiveVideoEventType[] = [ 'views-change', 'state-change' ]
+
+    for (const type of types) {
+      this.liveVideosSocket.on(type, (payload: LiveVideoEventPayload) => this.dispatchLiveVideoEvent(type, payload))
+    }
   }
 
   private async importIOIfNeeded () {