0
0
Fork 0
mirror of https://github.com/VueTubeApp/VueTube synced 2024-11-19 09:45:14 +00:00
VueTube/NUXT/components/CompactRenderers/compactVideoRenderer.vue

50 lines
1.3 KiB
Vue
Raw Normal View History

<template>
2022-04-23 05:22:18 +00:00
<base-video-renderer
:vidId="video.videoId"
:thumbnails="video.thumbnail.thumbnails"
2022-04-23 05:53:24 +00:00
:thumbnailOverlayStyle="thumbnailOverlayStyle"
:thumbnailOverlayText="thumbnailOverlayText"
2022-04-23 05:22:18 +00:00
:channelUrl="
this.$rendererUtils.getNavigationEndpoints(video.shortBylineText.runs[0])
"
:channelIcon="video.channelThumbnail.thumbnails[0].url"
:titles="video.title.runs"
:bottomText="parseBottom(video)"
>
2022-04-23 05:22:18 +00:00
</base-video-renderer>
</template>
<script>
2022-04-23 05:23:55 +00:00
import baseVideoRenderer from "~/components/UtilRenderers/baseVideoRenderer.vue";
export default {
props: ["video"],
2022-04-23 05:22:18 +00:00
components: {
baseVideoRenderer,
},
2022-04-23 05:53:24 +00:00
computed: {
thumbnailOverlayText() {
return this.video.thumbnailOverlays[0]?.thumbnailOverlayTimeStatusRenderer
?.text.runs[0].text;
},
thumbnailOverlayStyle() {
return this.video.thumbnailOverlays[0]?.thumbnailOverlayTimeStatusRenderer
?.style;
},
},
methods: {
parseBottom(video) {
const bottomText = [
video.shortBylineText?.runs[0].text,
video.shortViewCountText?.runs[0].text,
];
if (video.publishedTimeText?.runs[0].text)
bottomText.push(video.publishedTimeText?.runs[0].text);
return bottomText.join(" · ");
},
},
};
</script>