diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2019-12-11 20:20:42 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2019-12-13 09:13:43 +0100 |
commit | bee29df8a9ba3090be3daa8ff806dd9a26d7a5cf (patch) | |
tree | 9e9f6d509ed24f799f82667109498b9561474a4d /client/src/app/videos/recommendations | |
parent | d816f3a063febac1cad09ab3a32e5f0d29353627 (diff) | |
download | PeerTube-bee29df8a9ba3090be3daa8ff806dd9a26d7a5cf.tar.gz PeerTube-bee29df8a9ba3090be3daa8ff806dd9a26d7a5cf.tar.zst PeerTube-bee29df8a9ba3090be3daa8ff806dd9a26d7a5cf.zip |
autoplay next video support for playlists
Diffstat (limited to 'client/src/app/videos/recommendations')
-rw-r--r-- | client/src/app/videos/recommendations/recommended-videos.component.html | 8 | ||||
-rw-r--r-- | client/src/app/videos/recommendations/recommended-videos.component.ts | 4 |
2 files changed, 8 insertions, 4 deletions
diff --git a/client/src/app/videos/recommendations/recommended-videos.component.html b/client/src/app/videos/recommendations/recommended-videos.component.html index 5f223078a..c82642c1c 100644 --- a/client/src/app/videos/recommendations/recommended-videos.component.html +++ b/client/src/app/videos/recommendations/recommended-videos.component.html | |||
@@ -4,15 +4,17 @@ | |||
4 | <div i18n class="title-page title-page-single"> | 4 | <div i18n class="title-page title-page-single"> |
5 | Other videos | 5 | Other videos |
6 | </div> | 6 | </div> |
7 | <div class="d-flex title-page-autoplay"> | 7 | <div *ngIf="!playlist" class="d-flex title-page-autoplay"> |
8 | <span>Autoplay</span> | 8 | <span i18n>Autoplay</span> |
9 | <p-inputSwitch [(ngModel)]="autoPlayNextVideo" (ngModelChange)="switchAutoPlayNextVideo()"></p-inputSwitch> | 9 | <p-inputSwitch [(ngModel)]="autoPlayNextVideo" (ngModelChange)="switchAutoPlayNextVideo()"></p-inputSwitch> |
10 | </div> | 10 | </div> |
11 | </div> | 11 | </div> |
12 | 12 | ||
13 | <div *ngFor="let video of (videos$ | async)"> | 13 | <div *ngFor="let video of (videos$ | async); let i = index; let length = count"> |
14 | <my-video-miniature [video]="video" [user]="user" (videoBlacklisted)="onVideoRemoved()" (videoRemoved)="onVideoRemoved()"> | 14 | <my-video-miniature [video]="video" [user]="user" (videoBlacklisted)="onVideoRemoved()" (videoRemoved)="onVideoRemoved()"> |
15 | </my-video-miniature> | 15 | </my-video-miniature> |
16 | |||
17 | <hr *ngIf="!playlist && i == 0 && length > 1" /> | ||
16 | </div> | 18 | </div> |
17 | </ng-container> | 19 | </ng-container> |
18 | </div> | 20 | </div> |
diff --git a/client/src/app/videos/recommendations/recommended-videos.component.ts b/client/src/app/videos/recommendations/recommended-videos.component.ts index 4c3cde225..771ae54a2 100644 --- a/client/src/app/videos/recommendations/recommended-videos.component.ts +++ b/client/src/app/videos/recommendations/recommended-videos.component.ts | |||
@@ -1,6 +1,7 @@ | |||
1 | import { Component, Input, Output, OnChanges, EventEmitter } from '@angular/core' | 1 | import { Component, Input, Output, OnChanges, EventEmitter } from '@angular/core' |
2 | import { Observable } from 'rxjs' | 2 | import { Observable } from 'rxjs' |
3 | import { Video } from '@app/shared/video/video.model' | 3 | import { Video } from '@app/shared/video/video.model' |
4 | import { VideoPlaylist } from '@app/shared/video-playlist/video-playlist.model' | ||
4 | import { RecommendationInfo } from '@app/shared/video/recommendation-info.model' | 5 | import { RecommendationInfo } from '@app/shared/video/recommendation-info.model' |
5 | import { RecommendedVideosStore } from '@app/videos/recommendations/recommended-videos.store' | 6 | import { RecommendedVideosStore } from '@app/videos/recommendations/recommended-videos.store' |
6 | import { User } from '@app/shared' | 7 | import { User } from '@app/shared' |
@@ -14,10 +15,11 @@ import { peertubeLocalStorage } from '@app/shared/misc/peertube-local-storage' | |||
14 | styleUrls: [ './recommended-videos.component.scss' ] | 15 | styleUrls: [ './recommended-videos.component.scss' ] |
15 | }) | 16 | }) |
16 | export class RecommendedVideosComponent implements OnChanges { | 17 | export class RecommendedVideosComponent implements OnChanges { |
17 | private static LOCAL_STORAGE_AUTO_PLAY_NEXT_VIDEO = 'auto_play_next_video' | 18 | static LOCAL_STORAGE_AUTO_PLAY_NEXT_VIDEO = 'auto_play_next_video' |
18 | 19 | ||
19 | @Input() inputRecommendation: RecommendationInfo | 20 | @Input() inputRecommendation: RecommendationInfo |
20 | @Input() user: User | 21 | @Input() user: User |
22 | @Input() playlist: VideoPlaylist | ||
21 | @Output() gotRecommendations = new EventEmitter<Video[]>() | 23 | @Output() gotRecommendations = new EventEmitter<Video[]>() |
22 | 24 | ||
23 | readonly hasVideos$: Observable<boolean> | 25 | readonly hasVideos$: Observable<boolean> |