]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame_incremental - client/src/app/shared/video/video-thumbnail.component.ts
add resize listener (#1182)
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / video / video-thumbnail.component.ts
... / ...
CommitLineData
1import { Component, Input } from '@angular/core'
2import { Video } from './video.model'
3import { ScreenService } from '@app/shared/misc/screen.service'
4
5@Component({
6 selector: 'my-video-thumbnail',
7 styleUrls: [ './video-thumbnail.component.scss' ],
8 templateUrl: './video-thumbnail.component.html'
9})
10export class VideoThumbnailComponent {
11 @Input() video: Video
12 @Input() nsfw = false
13
14 constructor (private screenService: ScreenService) {}
15
16 getImageUrl () {
17 if (!this.video) return ''
18
19 if (this.screenService.isInMobileView()) {
20 return this.video.previewUrl
21 }
22
23 return this.video.thumbnailUrl
24 }
25}