diff --git a/src/App.vue b/src/App.vue index 6280cb1..c538694 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,15 +1,19 @@ @@ -55,9 +71,34 @@ function handleRedirectPlayer() {
- - + + +
+
+
+
+
+
+
+
+
+
+
+
+
+ +
diff --git a/src/catalogData.ts b/src/catalogData.ts index 82f1318..5862439 100644 --- a/src/catalogData.ts +++ b/src/catalogData.ts @@ -13,6 +13,7 @@ export type CatalogVideo = { technologies?: string[]; learnings?: string[]; relatedIds?: string[]; + manifestUrl?: string; // URL do manifest.remote.json para buscar thumbnail e duration real }; export type CatalogCarousel = { @@ -75,7 +76,8 @@ export const catalogData: CatalogData = { 'Compartilhamento de componentes', 'Gestão de dependências' ], - relatedIds: ['2', '3', '5'] + relatedIds: ['2', '3', '5'], + manifestUrl: 'https://d2ov2y0lwp0e6t.cloudfront.net/videos/video2/manifest.remote.json' }, { id: '2', diff --git a/src/components/VideoCard.vue b/src/components/VideoCard.vue index f52620f..52248cd 100644 --- a/src/components/VideoCard.vue +++ b/src/components/VideoCard.vue @@ -3,13 +3,13 @@ @mouseleave="() => isHovered = false" @click="() => emit('select', id)">
-
- {{ duration }} + {{ displayDuration }}
Assistir @@ -47,7 +47,9 @@ \ No newline at end of file diff --git a/src/components/VideoCarousel.vue b/src/components/VideoCarousel.vue index 170ea9c..458ee47 100644 --- a/src/components/VideoCarousel.vue +++ b/src/components/VideoCarousel.vue @@ -5,7 +5,7 @@ {{ title }} -
+
-
+
-
- -
-
-
+ + +
+
@@ -45,17 +59,19 @@ interface Video { thumbnail: string; duration: string; category: string; + manifestUrl?: string; } interface VideoCarouselProps { - title: string; - videos: Video[]; + title: string; + videos: Video[]; + loading?: boolean; } const props = defineProps(); const emit = defineEmits<{ (e: 'select', id: string): void }>(); -const { title, videos } = props; +const { title, videos, loading = false } = props as any; const [emblaRef, emblaApi] = emblaCarouselVue({ loop: false, @@ -66,6 +82,7 @@ const canPrev = ref(false); const canNext = ref(false); const slidesPerView = ref(5); const slidesToScroll = ref(3); +const skeletonCount = ref(10); const emblaRootEl = ref(null); const emblaWrapperRef = ref(null); diff --git a/src/components/VideoDetailsDialog.vue b/src/components/VideoDetailsDialog.vue index 7b23e94..672abb4 100644 --- a/src/components/VideoDetailsDialog.vue +++ b/src/components/VideoDetailsDialog.vue @@ -11,6 +11,7 @@ import { X, } from 'lucide-vue-next'; import VideoCard from './VideoCard.vue'; +import { navigateToPlayerByVideoId } from '../shared/navigation'; const props = defineProps<{ open: boolean, @@ -57,6 +58,12 @@ onBeforeUnmount(() => { }); const relatedVideos = computed(() => props.related || []); + +function handleWatch() { + if (props.video?.id) { + navigateToPlayerByVideoId(props.video.id); + } +}