Skip to content
This repository has been archived by the owner on Feb 5, 2023. It is now read-only.

Commit

Permalink
fix: video preview NFTs
Browse files Browse the repository at this point in the history
  • Loading branch information
Candinya committed Sep 7, 2021
1 parent 278955a commit 3e4d965
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions src/components/NFT/NFTItem.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,26 @@
<template>
<div
class="nft-item"
<img
v-if="!(imageUrl?.endsWith('mp4') || imageUrl?.endsWith('mov'))"
:style="{
width: size + 'px',
height: size + 'px',
backgroundImage: `url(${imageUrl})`,
}"
:src="imageUrl"
class="nft-item"
/>
<video
v-else
:style="{
width: size + 'px',
height: size + 'px',
}"
class="nft-item"
autoplay
loop
muted
>
<source :src="imageUrl" :type="`video/${imageUrl.substring(imageUrl.lastIndexOf('.') + 1)}`" />
</video>
</template>
<script lang="ts">
Expand Down

0 comments on commit 3e4d965

Please sign in to comment.