1 import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'
2 import { AuthService } from '@app/core'
3 import { Video, VideoService } from '../../shared-main'
4 import { MiniatureDisplayOptions } from '../../shared-video-miniature'
5 import { CustomMarkupComponent } from './shared'
8 * Markup component that creates a video miniature only
12 selector: 'my-video-miniature-markup',
13 templateUrl: 'video-miniature-markup.component.html',
14 styleUrls: [ 'video-miniature-markup.component.scss' ]
16 export class VideoMiniatureMarkupComponent implements CustomMarkupComponent, OnInit {
18 @Input() onlyDisplayTitle: boolean
20 @Output() loaded = new EventEmitter<boolean>()
24 displayOptions: MiniatureDisplayOptions = {
36 private auth: AuthService,
37 private videoService: VideoService
41 return this.auth.getUser()
45 if (this.onlyDisplayTitle) {
46 for (const key of Object.keys(this.displayOptions)) {
47 this.displayOptions[key] = false
51 this.videoService.getVideo({ videoId: this.uuid })
53 next: video => this.video = video,
55 complete: () => this.loaded.emit(true)