diff options
Diffstat (limited to 'client/src/app/shared/shared-custom-markup/peertube-custom-tags/video-miniature-markup.component.ts')
-rw-r--r-- | client/src/app/shared/shared-custom-markup/peertube-custom-tags/video-miniature-markup.component.ts | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/video-miniature-markup.component.ts b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/video-miniature-markup.component.ts index dfb4c497f..6ee5123e0 100644 --- a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/video-miniature-markup.component.ts +++ b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/video-miniature-markup.component.ts | |||
@@ -1,7 +1,8 @@ | |||
1 | import { Component, Input, OnInit } from '@angular/core' | 1 | import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core' |
2 | import { AuthService } from '@app/core' | 2 | import { AuthService } from '@app/core' |
3 | import { Video, VideoService } from '../../shared-main' | 3 | import { Video, VideoService } from '../../shared-main' |
4 | import { MiniatureDisplayOptions } from '../../shared-video-miniature' | 4 | import { MiniatureDisplayOptions } from '../../shared-video-miniature' |
5 | import { CustomMarkupComponent } from './shared' | ||
5 | 6 | ||
6 | /* | 7 | /* |
7 | * Markup component that creates a video miniature only | 8 | * Markup component that creates a video miniature only |
@@ -12,10 +13,12 @@ import { MiniatureDisplayOptions } from '../../shared-video-miniature' | |||
12 | templateUrl: 'video-miniature-markup.component.html', | 13 | templateUrl: 'video-miniature-markup.component.html', |
13 | styleUrls: [ 'video-miniature-markup.component.scss' ] | 14 | styleUrls: [ 'video-miniature-markup.component.scss' ] |
14 | }) | 15 | }) |
15 | export class VideoMiniatureMarkupComponent implements OnInit { | 16 | export class VideoMiniatureMarkupComponent implements CustomMarkupComponent, OnInit { |
16 | @Input() uuid: string | 17 | @Input() uuid: string |
17 | @Input() onlyDisplayTitle: boolean | 18 | @Input() onlyDisplayTitle: boolean |
18 | 19 | ||
20 | @Output() loaded = new EventEmitter<boolean>() | ||
21 | |||
19 | video: Video | 22 | video: Video |
20 | 23 | ||
21 | displayOptions: MiniatureDisplayOptions = { | 24 | displayOptions: MiniatureDisplayOptions = { |
@@ -46,6 +49,10 @@ export class VideoMiniatureMarkupComponent implements OnInit { | |||
46 | } | 49 | } |
47 | 50 | ||
48 | this.videoService.getVideo({ videoId: this.uuid }) | 51 | this.videoService.getVideo({ videoId: this.uuid }) |
49 | .subscribe(video => this.video = video) | 52 | .subscribe({ |
53 | next: video => this.video = video, | ||
54 | |||
55 | complete: () => this.loaded.emit(true) | ||
56 | }) | ||
50 | } | 57 | } |
51 | } | 58 | } |