mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 14:31:26 +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)"/>
|
:alt="altText(status)"/>
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="embed-responsive embed-responsive-16by9">
|
<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">
|
<source :src="status.media_attachments[0].url" :type="status.media_attachments[0].mime">
|
||||||
</video>
|
</video>
|
||||||
</div>
|
</div>
|
||||||
|
@ -76,7 +76,15 @@
|
||||||
|
|
||||||
toggleContentWarning(status) {
|
toggleContentWarning(status) {
|
||||||
this.$emit('togglecw');
|
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>
|
</script>
|
||||||
|
|
Loading…
Reference in a new issue