Skip to content

Commit 5f65fd5

Browse files
KianNHthomasgauvin
authored andcommitted
[Docs Site] Wrap Stream component in div (#24042)
1 parent 708afda commit 5f65fd5

File tree

1 file changed

+61
-59
lines changed

1 file changed

+61
-59
lines changed

src/components/Stream.astro

Lines changed: 61 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -39,66 +39,68 @@ if (thumbnail) {
3939
}
4040
---
4141

42-
<stream-player data-id={id} data-title={title}>
43-
<div style="position: relative; padding-top: 56.25%">
44-
<iframe
45-
src={url.toString()}
46-
style="border: none; position: absolute; top: 0; left: 0; height: 100%; width: 100%;"
47-
allow="accelerometer; gyroscope; autoplay; encrypted-media; picture-in-picture;"
48-
allowfullscreen="true"
49-
title={title}
50-
id={id}></iframe>
51-
</div>
52-
53-
{
54-
chapters && (
55-
<p>
56-
<strong>Chapters</strong>
57-
<ul class="flex list-none gap-4 overflow-x-scroll pb-4 pl-0">
58-
{Object.entries(chapters).map(([chapter, time]) => {
59-
const totalSeconds = parse(time, "s");
60-
61-
const thumbnail = new URL(thumbnailUrl);
62-
thumbnail.searchParams.set("fit", "crop");
63-
thumbnail.searchParams.set("time", `${totalSeconds}s`);
64-
65-
return (
66-
<li class="mt-0!">
67-
<button
68-
class="flex h-full w-36 cursor-pointer flex-col rounded-sm border border-gray-200 bg-transparent p-4 dark:border-gray-700"
69-
data-chapter={chapter}
70-
data-time={totalSeconds}
71-
>
72-
<img
73-
src={thumbnail.toString()}
74-
alt={chapter}
75-
width="120"
76-
height="64"
77-
class="border-accent bg-accent/10 rounded-sm border"
78-
/>
79-
<div class="flex h-full flex-col items-center justify-between">
80-
<strong class="line-clamp-2 text-xs" title={chapter}>
81-
{chapter}
82-
</strong>
83-
<Badge text={time} variant="tip" class="w-fit" />
84-
</div>
85-
</button>
86-
</li>
87-
);
88-
})}
89-
</ul>
90-
</p>
91-
)
92-
}
42+
<div>
43+
<stream-player data-id={id} data-title={title}>
44+
<div style="position: relative; padding-top: 56.25%">
45+
<iframe
46+
src={url.toString()}
47+
style="border: none; position: absolute; top: 0; left: 0; height: 100%; width: 100%;"
48+
allow="accelerometer; gyroscope; autoplay; encrypted-media; picture-in-picture;"
49+
allowfullscreen="true"
50+
title={title}
51+
id={id}></iframe>
52+
</div>
53+
54+
{
55+
chapters && (
56+
<p>
57+
<strong>Chapters</strong>
58+
<ul class="flex list-none gap-4 overflow-x-scroll pb-4 pl-0">
59+
{Object.entries(chapters).map(([chapter, time]) => {
60+
const totalSeconds = parse(time, "s");
61+
62+
const thumbnail = new URL(thumbnailUrl);
63+
thumbnail.searchParams.set("fit", "crop");
64+
thumbnail.searchParams.set("time", `${totalSeconds}s`);
65+
66+
return (
67+
<li class="mt-0!">
68+
<button
69+
class="flex h-full w-36 cursor-pointer flex-col rounded-sm border border-gray-200 bg-transparent p-4 dark:border-gray-700"
70+
data-chapter={chapter}
71+
data-time={totalSeconds}
72+
>
73+
<img
74+
src={thumbnail.toString()}
75+
alt={chapter}
76+
width="120"
77+
height="64"
78+
class="border-accent bg-accent/10 rounded-sm border"
79+
/>
80+
<div class="flex h-full flex-col items-center justify-between">
81+
<strong class="line-clamp-2 text-xs" title={chapter}>
82+
{chapter}
83+
</strong>
84+
<Badge text={time} variant="tip" class="w-fit" />
85+
</div>
86+
</button>
87+
</li>
88+
);
89+
})}
90+
</ul>
91+
</p>
92+
)
93+
}
9394

94-
{
95-
showMoreVideos && (
96-
<a href="https://www.youtube.com/@CloudflareDevelopers" target="_blank">
97-
Watch more videos on our Developer Channel
98-
</a>
99-
)
100-
}
101-
</stream-player>
95+
{
96+
showMoreVideos && (
97+
<a href="https://www.youtube.com/@CloudflareDevelopers" target="_blank">
98+
Watch more videos on our Developer Channel
99+
</a>
100+
)
101+
}
102+
</stream-player>
103+
</div>
102104

103105
<script is:inline src="https://embed.cloudflarestream.com/embed/sdk.latest.js"
104106
></script>

0 commit comments

Comments
 (0)