mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-10 00:34:50 +00:00
Use poster in VideoPresenter component
This commit is contained in:
parent
47571887fe
commit
a3cc90b0c5
1 changed files with 10 additions and 2 deletions
|
@ -22,7 +22,7 @@
|
|||
:alt="altText(status)"/>
|
||||
</div>
|
||||
<div v-else class="embed-responsive embed-responsive-16by9">
|
||||
<video class="video" controls playsinline preload="metadata" loop :data-id="status.id">
|
||||
<video class="video" controls playsinline preload="metadata" loop :data-id="status.id" :poster="poster()">
|
||||
<source :src="status.media_attachments[0].url" :type="status.media_attachments[0].mime">
|
||||
</video>
|
||||
</div>
|
||||
|
@ -76,7 +76,15 @@
|
|||
|
||||
toggleContentWarning(status) {
|
||||
this.$emit('togglecw');
|
||||
}
|
||||
},
|
||||
|
||||
poster() {
|
||||
let url = this.status.media_attachments[0].preview_url;
|
||||
if(url.endsWith('no-preview.jpg') || url.endsWith('no-preview.png')) {
|
||||
return;
|
||||
}
|
||||
return url;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
Loading…
Reference in a new issue