aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/videos/recommendations
diff options
context:
space:
mode:
authorLoveIsGrief <LoveIsGrief@users.noreply.github.com>2019-09-24 08:48:01 +0200
committerChocobozzz <me@florianbigard.com>2019-09-24 08:48:01 +0200
commit6aa541481390980f9c85d2e66514ba0e6ce77a35 (patch)
tree7b2e934647a732645c69e5d05e4b18152b50a6b8 /client/src/app/videos/recommendations
parent32d7f2b754b8d20bf44ae2121c79570cbff973c3 (diff)
downloadPeerTube-6aa541481390980f9c85d2e66514ba0e6ce77a35.tar.gz
PeerTube-6aa541481390980f9c85d2e66514ba0e6ce77a35.tar.zst
PeerTube-6aa541481390980f9c85d2e66514ba0e6ce77a35.zip
Autoplay next recommended video (#2137)
* Start working on autoplay of next video * Ignore changes made by gitpod * Apply changes from PR#1370 * Correct the spelling of recommendations * Fix linting errors * Move boolean check to existing onEnded handler * Pick a random video until the recommendations are improved * Add simple tests for autoPlayNextVideo * Fix lint ...again
Diffstat (limited to 'client/src/app/videos/recommendations')
-rw-r--r--client/src/app/videos/recommendations/recommended-videos.component.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/client/src/app/videos/recommendations/recommended-videos.component.ts b/client/src/app/videos/recommendations/recommended-videos.component.ts
index 68fd750cc..7e0fb8856 100644
--- a/client/src/app/videos/recommendations/recommended-videos.component.ts
+++ b/client/src/app/videos/recommendations/recommended-videos.component.ts
@@ -1,4 +1,4 @@
1import { Component, Input, OnChanges } from '@angular/core' 1import { Component, Input, Output, OnChanges, EventEmitter } from '@angular/core'
2import { Observable } from 'rxjs' 2import { Observable } from 'rxjs'
3import { Video } from '@app/shared/video/video.model' 3import { Video } from '@app/shared/video/video.model'
4import { RecommendationInfo } from '@app/shared/video/recommendation-info.model' 4import { RecommendationInfo } from '@app/shared/video/recommendation-info.model'
@@ -12,6 +12,7 @@ import { User } from '@app/shared'
12export class RecommendedVideosComponent implements OnChanges { 12export class RecommendedVideosComponent implements OnChanges {
13 @Input() inputRecommendation: RecommendationInfo 13 @Input() inputRecommendation: RecommendationInfo
14 @Input() user: User 14 @Input() user: User
15 @Output() gotRecommendations = new EventEmitter<Video[]>()
15 16
16 readonly hasVideos$: Observable<boolean> 17 readonly hasVideos$: Observable<boolean>
17 readonly videos$: Observable<Video[]> 18 readonly videos$: Observable<Video[]>
@@ -21,6 +22,7 @@ export class RecommendedVideosComponent implements OnChanges {
21 ) { 22 ) {
22 this.videos$ = this.store.recommendations$ 23 this.videos$ = this.store.recommendations$
23 this.hasVideos$ = this.store.hasRecommendations$ 24 this.hasVideos$ = this.store.hasRecommendations$
25 this.videos$.subscribe(videos => this.gotRecommendations.emit(videos))
24 } 26 }
25 27
26 public ngOnChanges (): void { 28 public ngOnChanges (): void {