projects
/
oweals
/
peertube.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Trending by interval
[oweals/peertube.git]
/
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 e543e9903bbf1855bc7e5d820b07f1f699634c30..86d8f6f742163f91fd8c1a486a7797162feeb2aa 100644
(file)
--- a/
client/src/app/shared/video/video-thumbnail.component.ts
+++ b/
client/src/app/shared/video/video-thumbnail.component.ts
@@
-1,5
+1,6
@@
import { Component, Input } from '@angular/core'
import { Video } from './video.model'
import { Component, Input } from '@angular/core'
import { Video } from './video.model'
+import { ScreenService } from '@app/shared/misc/screen.service'
@Component({
selector: 'my-video-thumbnail',
@Component({
selector: 'my-video-thumbnail',
@@
-9,4
+10,16
@@
import { Video } from './video.model'
export class VideoThumbnailComponent {
@Input() video: Video
@Input() nsfw = false
export class VideoThumbnailComponent {
@Input() video: Video
@Input() nsfw = false
+
+ constructor (private screenService: ScreenService) {}
+
+ getImageUrl () {
+ if (!this.video) return ''
+
+ if (this.screenService.isInMobileView()) {
+ return this.video.previewUrl
+ }
+
+ return this.video.thumbnailUrl
+ }
}
}