2022-04-04 11:33:16 +00:00
|
|
|
<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="
|
|
|
|
$rendererUtils.getNavigationEndpoints(
|
|
|
|
video.shortBylineText.runs[0].navigationEndpoint
|
|
|
|
)
|
|
|
|
"
|
|
|
|
:channelIcon="
|
|
|
|
video.channelThumbnail.channelThumbnailWithLinkRenderer.thumbnail
|
|
|
|
.thumbnails[0].url
|
|
|
|
"
|
|
|
|
:titles="video.headline.runs"
|
|
|
|
:bottomText="parseBottom(video)"
|
2022-04-04 11:33:16 +00:00
|
|
|
>
|
2022-04-23 05:22:18 +00:00
|
|
|
</base-video-renderer>
|
2022-04-04 11:33:16 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2022-04-23 05:23:55 +00:00
|
|
|
import baseVideoRenderer from "~/components/UtilRenderers/baseVideoRenderer.vue";
|
2022-04-04 11:33:16 +00:00
|
|
|
export default {
|
|
|
|
props: ["video"],
|
|
|
|
|
2022-04-23 05:22:18 +00:00
|
|
|
components: {
|
|
|
|
baseVideoRenderer,
|
|
|
|
},
|
|
|
|
|
2022-04-23 05:53:24 +00:00
|
|
|
computed: {
|
|
|
|
thumbnailOverlayText() {
|
2023-05-14 15:51:03 +00:00
|
|
|
this.video.thumbnailOverlays.forEach((thumbnail) => {
|
|
|
|
if (thumbnail.thumbnailOverlayTimeStatusRenderer) {
|
|
|
|
return thumbnail.thumbnailOverlayTimeStatusRenderer.text.runs[0].text;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
return "";
|
2022-04-23 05:53:24 +00:00
|
|
|
},
|
|
|
|
thumbnailOverlayStyle() {
|
2023-05-14 15:51:03 +00:00
|
|
|
this.video.thumbnailOverlays.forEach((thumbnail) => {
|
|
|
|
if (thumbnail.thumbnailOverlayTimeStatusRenderer) {
|
|
|
|
return thumbnail.thumbnailOverlayTimeStatusRenderer.style;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
return "DEFAULT";
|
2022-04-23 05:53:24 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2022-04-04 11:33:16 +00:00
|
|
|
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>
|