Skip to content

Commit 9b86d21

Browse files
committed
add video
1 parent 5860d97 commit 9b86d21

File tree

3 files changed

+47
-4
lines changed

3 files changed

+47
-4
lines changed
59.7 MB
Binary file not shown.

src/components/widgets/Hero.astro

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,15 @@ const {
9393
</div>
9494
)
9595
}
96+
97+
{
98+
// Check for custom video slot content
99+
(await Astro.slots.has('video')) && (
100+
<div class="relative m-auto max-w-5xl">
101+
<slot name="video" />
102+
</div>
103+
)
104+
}
96105
</div>
97106
</div>
98107
</div>

src/pages/index.astro

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ import Content from '~/components/widgets/Content.astro';
88
import Steps from '~/components/widgets/Steps.astro';
99
import CallToAction from '~/components/widgets/CallToAction.astro';
1010
11+
// Video from public folder
12+
const heroVideoUrl = "/assets/videos/f8eb693a22d0c0f74997b806d4a51210.mp4";
13+
1114
const metadata = {
1215
title: 'Agent Orchestration System Platform - aios-rs',
1316
ignoreTitleTemplate: true,
@@ -18,17 +21,48 @@ const metadata = {
1821
<Layout metadata={metadata}>
1922
<!-- Hero Widget ******************* -->
2023

21-
<Hero
22-
actions={[]}
23-
image={{ src: 'https://images.unsplash.com/photo-1677442136019-21780ecad995?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=2070&q=80', alt: '企业级Agent Orchestration System Platform' }}
24-
>
24+
<Hero actions={[]} image={null}>
2525
<Fragment slot="title">
2626
<span class="text-accent dark:text-white">Agent Orchestration System Platform</span>
2727
</Fragment>
2828

2929
<Fragment slot="subtitle">
3030
企业级智能体系统,构建AI原生的企业业务系统底座。
3131
</Fragment>
32+
33+
<Fragment slot="video">
34+
<video
35+
id="hero-video"
36+
class="mx-auto rounded-md w-full aspect-video shadow-2xl bg-black"
37+
autoplay
38+
muted
39+
loop
40+
playsinline
41+
preload="auto"
42+
controls
43+
>
44+
<source src={heroVideoUrl} type="video/mp4" />
45+
您的浏览器不支持视频播放。
46+
</video>
47+
48+
<script is:inline>
49+
// Simple autoplay guarantee
50+
const video = document.getElementById('hero-video');
51+
if (video) {
52+
video.muted = true;
53+
54+
// Try to play immediately
55+
video.play().catch(() => {
56+
// Fallback on user interaction
57+
const play = () => {
58+
video.play();
59+
document.removeEventListener('click', play);
60+
};
61+
document.addEventListener('click', play);
62+
});
63+
}
64+
</script>
65+
</Fragment>
3266
</Hero>
3367

3468
<!-- Note Widget ******************* -->

0 commit comments

Comments
 (0)