]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/video/video-thumbnail.component.ts
Replace current state when changing page
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / video / video-thumbnail.component.ts
index e543e9903bbf1855bc7e5d820b07f1f699634c30..e52f7dfb0824f2da18389a7a73a49d6a961c5a6c 100644 (file)
@@ -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
+  }
 }