2021-06-17 00:44:46 +05:30
|
|
|
<template>
|
2021-12-28 05:34:20 +05:30
|
|
|
<div>
|
|
|
|
<router-link :to="video.url">
|
2021-12-27 20:16:30 +05:30
|
|
|
<img :height="height" :width="width" class="w-full" :src="video.thumbnail" alt="" loading="lazy" />
|
2021-12-27 20:16:33 +05:30
|
|
|
<div class="relative text-sm">
|
2021-12-27 21:59:25 +05:30
|
|
|
<span
|
|
|
|
v-if="video.duration"
|
2022-01-12 17:29:50 +05:30
|
|
|
class="thumbnail-overlay bottom-5px right-5px px-5px"
|
2021-12-27 21:59:25 +05:30
|
|
|
v-text="timeFormat(video.duration)"
|
|
|
|
/>
|
|
|
|
<span
|
|
|
|
v-if="video.watched"
|
2022-01-12 17:29:50 +05:30
|
|
|
class="thumbnail-overlay bottom-5px left-5px px-5px"
|
2021-12-27 21:59:25 +05:30
|
|
|
v-text="$t('video.watched')"
|
|
|
|
/>
|
2021-07-21 15:45:07 +05:30
|
|
|
</div>
|
2021-09-02 15:58:32 +05:30
|
|
|
|
|
|
|
<div>
|
2021-10-08 04:14:54 +05:30
|
|
|
<p
|
2021-12-28 20:09:20 +05:30
|
|
|
style="display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical"
|
2021-12-27 20:16:30 +05:30
|
|
|
class="my-2 overflow-hidden flex link"
|
2021-10-08 04:14:54 +05:30
|
|
|
:title="video.title"
|
2021-12-27 21:59:25 +05:30
|
|
|
v-text="video.title"
|
|
|
|
/>
|
2021-09-02 15:58:32 +05:30
|
|
|
</div>
|
2021-06-17 00:44:46 +05:30
|
|
|
</router-link>
|
|
|
|
|
2022-01-12 17:29:50 +05:30
|
|
|
<div class="float-right m-0 inline-block">
|
2021-10-08 04:14:54 +05:30
|
|
|
<router-link
|
|
|
|
:to="video.url + '&listen=1'"
|
|
|
|
:aria-label="'Listen to ' + video.title"
|
|
|
|
:title="'Listen to ' + video.title"
|
|
|
|
>
|
2021-12-28 04:03:55 +05:30
|
|
|
<font-awesome-icon icon="headphones" />
|
2021-09-02 15:58:32 +05:30
|
|
|
</router-link>
|
|
|
|
</div>
|
|
|
|
|
2022-01-12 17:29:50 +05:30
|
|
|
<div class="flex">
|
2021-12-28 05:34:20 +05:30
|
|
|
<router-link :to="video.uploaderUrl">
|
2021-10-08 04:14:54 +05:30
|
|
|
<img
|
|
|
|
v-if="video.uploaderAvatar"
|
|
|
|
:src="video.uploaderAvatar"
|
|
|
|
loading="lazy"
|
|
|
|
:alt="video.uploaderName"
|
2021-12-27 20:16:29 +05:30
|
|
|
class="rounded-full mr-0.5 mt-0.5 w-32px h-32px"
|
2021-12-27 20:16:31 +05:30
|
|
|
width="68"
|
|
|
|
height="68"
|
2021-10-08 04:14:54 +05:30
|
|
|
/>
|
2021-09-02 15:58:32 +05:30
|
|
|
</router-link>
|
|
|
|
|
2021-12-27 20:16:29 +05:30
|
|
|
<div class="w-[calc(100%-32px-1rem)]">
|
2021-10-08 04:14:54 +05:30
|
|
|
<router-link
|
2021-10-09 02:38:41 +05:30
|
|
|
v-if="video.uploaderUrl && video.uploaderName && !hideChannel"
|
2021-12-28 05:34:20 +05:30
|
|
|
class="link-secondary overflow-hidden block"
|
2021-10-08 04:14:54 +05:30
|
|
|
:to="video.uploaderUrl"
|
|
|
|
:title="video.uploaderName"
|
|
|
|
>
|
2021-12-27 21:59:25 +05:30
|
|
|
<span v-text="video.uploaderName" />
|
2021-12-28 04:03:55 +05:30
|
|
|
<font-awesome-icon class="ml-1.5" v-if="video.uploaderVerified" icon="check" />
|
2021-06-17 00:44:46 +05:30
|
|
|
</router-link>
|
|
|
|
|
2022-01-12 16:57:08 +05:30
|
|
|
<strong v-if="video.views >= 0 || video.uploadedDate" class="text-sm">
|
2021-09-02 15:58:32 +05:30
|
|
|
<span v-if="video.views >= 0">
|
2021-12-28 04:03:55 +05:30
|
|
|
<font-awesome-icon icon="eye" />
|
2022-01-12 16:57:08 +05:30
|
|
|
<span class="pl-0.5" v-text="`${numberFormat(video.views)} •`" />
|
2021-09-02 15:58:32 +05:30
|
|
|
</span>
|
2022-01-12 16:57:08 +05:30
|
|
|
<span v-if="video.uploadedDate" class="pl-0.5" v-text="video.uploadedDate" />
|
|
|
|
<span v-if="video.uploaded" class="pl-0.5" v-text="timeAgo(video.uploaded)" />
|
2021-12-27 20:13:37 +05:30
|
|
|
</strong>
|
2021-06-17 00:44:46 +05:30
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
2021-12-27 20:16:29 +05:30
|
|
|
<style>
|
|
|
|
.thumbnail-overlay {
|
|
|
|
@apply rounded-md absolute bg-black bg-opacity-75;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
|
2021-06-17 00:44:46 +05:30
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
props: {
|
2021-10-09 00:22:51 +05:30
|
|
|
video: {
|
|
|
|
type: Object,
|
|
|
|
default: () => {
|
|
|
|
return {};
|
|
|
|
},
|
|
|
|
},
|
|
|
|
height: { type: String, default: "118" },
|
|
|
|
width: { type: String, default: "210" },
|
|
|
|
hideChannel: { type: Boolean, default: false },
|
2021-06-17 00:44:46 +05:30
|
|
|
},
|
|
|
|
};
|
2021-07-21 18:02:17 +05:30
|
|
|
</script>
|