diff options
Diffstat (limited to 'client/src/app/shared/video/video-thumbnail.component.ts')
-rw-r--r-- | client/src/app/shared/video/video-thumbnail.component.ts | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/client/src/app/shared/video/video-thumbnail.component.ts b/client/src/app/shared/video/video-thumbnail.component.ts index e543e9903..e52f7dfb0 100644 --- a/client/src/app/shared/video/video-thumbnail.component.ts +++ b/client/src/app/shared/video/video-thumbnail.component.ts | |||
@@ -1,4 +1,5 @@ | |||
1 | import { Component, Input } from '@angular/core' | 1 | import { Component, Input } from '@angular/core' |
2 | import { isInMobileView } from '@app/shared/misc/utils' | ||
2 | import { Video } from './video.model' | 3 | import { Video } from './video.model' |
3 | 4 | ||
4 | @Component({ | 5 | @Component({ |
@@ -9,4 +10,14 @@ import { Video } from './video.model' | |||
9 | export class VideoThumbnailComponent { | 10 | export class VideoThumbnailComponent { |
10 | @Input() video: Video | 11 | @Input() video: Video |
11 | @Input() nsfw = false | 12 | @Input() nsfw = false |
13 | |||
14 | getImageUrl () { | ||
15 | if (!this.video) return '' | ||
16 | |||
17 | if (isInMobileView()) { | ||
18 | return this.video.previewUrl | ||
19 | } | ||
20 | |||
21 | return this.video.thumbnailUrl | ||
22 | } | ||
12 | } | 23 | } |