From 6aa541481390980f9c85d2e66514ba0e6ce77a35 Mon Sep 17 00:00:00 2001 From: LoveIsGrief Date: Tue, 24 Sep 2019 08:48:01 +0200 Subject: 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 --- client/src/app/videos/recommendations/recommended-videos.component.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'client/src/app/videos/recommendations/recommended-videos.component.ts') 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 @@ -import { Component, Input, OnChanges } from '@angular/core' +import { Component, Input, Output, OnChanges, EventEmitter } from '@angular/core' import { Observable } from 'rxjs' import { Video } from '@app/shared/video/video.model' import { RecommendationInfo } from '@app/shared/video/recommendation-info.model' @@ -12,6 +12,7 @@ import { User } from '@app/shared' export class RecommendedVideosComponent implements OnChanges { @Input() inputRecommendation: RecommendationInfo @Input() user: User + @Output() gotRecommendations = new EventEmitter() readonly hasVideos$: Observable readonly videos$: Observable @@ -21,6 +22,7 @@ export class RecommendedVideosComponent implements OnChanges { ) { this.videos$ = this.store.recommendations$ this.hasVideos$ = this.store.hasRecommendations$ + this.videos$.subscribe(videos => this.gotRecommendations.emit(videos)) } public ngOnChanges (): void { -- cgit v1.2.3