From 51353d9a035fb6b81f903a8b5f391292841649fd Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 9 Nov 2021 10:11:20 +0100 Subject: Refactor video views Introduce viewers attribute for live videos Count views for live videos Reduce delay to see the viewer update for lives Add ability to configure video views buffer interval and view ip expiration --- client/src/app/+videos/+video-watch/video-watch.component.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'client/src/app/+videos/+video-watch') diff --git a/client/src/app/+videos/+video-watch/video-watch.component.ts b/client/src/app/+videos/+video-watch/video-watch.component.ts index 5ca9d5fa9..fd61bcbf0 100644 --- a/client/src/app/+videos/+video-watch/video-watch.component.ts +++ b/client/src/app/+videos/+video-watch/video-watch.component.ts @@ -658,7 +658,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy { return this.peertubeSocket.getLiveVideosObservable() .subscribe(({ type, payload }) => { if (type === 'state-change') return this.handleLiveStateChange(payload.state) - if (type === 'views-change') return this.handleLiveViewsChange(payload.views) + if (type === 'views-change') return this.handleLiveViewsChange(payload.viewers) }) } @@ -677,7 +677,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy { this.loadVideo(videoUUID) } - private handleLiveViewsChange (newViews: number) { + private handleLiveViewsChange (newViewers: number) { if (!this.video) { console.error('Cannot update video live views because video is no defined.') return @@ -685,7 +685,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy { console.log('Updating live views.') - this.video.views = newViews + this.video.viewers = newViewers } private initHotkeys () { -- cgit v1.2.3