Skip to content

Commit

Permalink
Use poster in VideoPresenter component
Browse files Browse the repository at this point in the history
  • Loading branch information
dansup committed Aug 4, 2022
1 parent 4757188 commit a3cc90b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions resources/assets/js/components/presenter/VideoPresenter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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>

0 comments on commit a3cc90b

Please sign in to comment.