组件 视频播放器 视频播放器组件

视频播放器组件

一个具有响应式设计和深色模式支持的复古/经典风格视频播放器组件,使用 Tailwind CSS。

预览

HTML 代码

<div class="flex flex-col items-center justify-center p-4 bg-gray-800 rounded-lg shadow-lg max-w-md w-full">
    <div class="relative w-full pt-9/16">
        <iframe class="absolute top-0 left-0 w-full h-full rounded-lg" src="https://www.youtube.com/embed/VIDEO_ID" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
    </div>
    <div class="flex justify-between items-center w-full mt-4 text-white">
        <div class="flex items-center">
            <img class="w-10 h-10 rounded-full mr-2" src="https://randomuser.me/api/portraits/men/1.jpg" alt="Avatar" />
            <span class="font-bold">Username</span>
        </div>
        <div class="flex items-center">
            <button class="bg-gray-700 hover:bg-gray-600 text-white font-bold py-2 px-4 rounded">
                Play
            </button>
            <button class="bg-gray-700 hover:bg-gray-600 text-white font-bold py-2 px-4 ml-2 rounded">
                Pause
            </button>
        </div>
    </div>
    <div class="flex flex-col w-full mt-4">
        <input type="range" class="appearance-none w-full h-2 bg-gray-600 rounded-lg" value="50" />
        <div class="flex justify-between text-xs text-gray-400">
            <span>0:00</span>
            <span>3:45</span>
        </div>
    </div>
</div>

<style>
    .pt-9\/16 {
        padding-top: 56.25%; /* 16:9 Aspect Ratio */
    }

    .dark {
        background-color: #1F2937;
    }
    .dark .bg-gray-800 {
        background-color: #4B5563;
    }
</style>

相关组件

视频播放器组件

一个为社交媒体界面设计的极简视频播放器组件,具有响应式布局和深色主题支持。

打开

视频播放器组件

一个采用玻璃拟态风格设计的响应式视频播放器组件,具有类似磨砂玻璃的半透明元素和模糊效果,支持深色主题,并带有占位图像。

打开

视频播放器组件

一个野兽派风格的视频播放器组件,具有高对比度和不寻常的布局,采用响应式设计并支持使用Tailwind CSS的深色主题。

打开