From 3290f37c76784f1b96cefb5d389e48db56033b0a Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 9 Feb 2018 09:30:37 +0100 Subject: Video previews take all the width on mobile --- client/src/app/shared/video/video-thumbnail.component.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'client/src/app/shared/video/video-thumbnail.component.ts') 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 @@ import { Component, Input } from '@angular/core' +import { isInMobileView } from '@app/shared/misc/utils' import { Video } from './video.model' @Component({ @@ -9,4 +10,14 @@ import { Video } from './video.model' export class VideoThumbnailComponent { @Input() video: Video @Input() nsfw = false + + getImageUrl () { + if (!this.video) return '' + + if (isInMobileView()) { + return this.video.previewUrl + } + + return this.video.thumbnailUrl + } } -- cgit v1.2.3