Video Player
Custom video player with controls
Preview
{ window.Prism.highlightElement($refs.codeEl) }) }"
class="w-full flex items-center justify-between px-6 py-4 text-left bg-gray-50 dark:bg-gray-900 hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors cursor-pointer">
View Code
<div x-data="{ playing: false, volume: 50 }">
<div class="relative bg-black rounded-lg overflow-hidden">
<video x-ref="video" class="w-full" src="your-video.mp4" @click="playing = !playing; playing ? $refs.video.play() : $refs.video.pause()"></video>
<div class="absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/80 p-4">
<div class="flex items-center gap-4">
<button @click="playing = !playing; playing ? $refs.video.play() : $refs.video.pause()" class="text-white">
<span x-show="!playing">▶</span>
<span x-show="playing">▮▮</span>
</button>
<input type="range" min="0" max="100" x-model="volume" @input="$refs.video.volume = volume / 100" class="w-24">
</div>
</div>
</div>
</div>