Custom Html5 Video Player Codepen Online

body background: linear-gradient(145deg, #0b1120 0%, #111827 100%); min-height: 100vh; display: flex; justify-content: center; align-items: center; font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif; padding: 1.5rem;

/* BUTTONS STYLE */ .ctrl-btn background: transparent; border: none; color: #f0f3fa; font-size: 1.35rem; width: 40px; height: 40px; border-radius: 40px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s cubic-bezier(0.2, 0.9, 0.4, 1.1); background: rgba(255, 255, 255, 0.05);

/* CUSTOM CONTROLS BAR */ .custom-controls background: rgba(10, 14, 23, 0.92); backdrop-filter: blur(12px); padding: 0.9rem 1.2rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem; border-top: 1px solid rgba(255, 255, 255, 0.12); transition: all 0.2s;

/* VIDEO WRAPPER (controls layer) */ .video-wrapper position: relative; width: 100%; background: #000; cursor: pointer; custom html5 video player codepen

<!-- Playback speed --> <select id="speedSelect" class="speed-select" aria-label="Playback Speed"> <option value="0.5">0.5x</option> <option value="0.75">0.75x</option> <option value="1" selected>1x</option> <option value="1.25">1.25x</option> <option value="1.5">1.5x</option> <option value="2">2x</option> </select>

<!-- Volume control with icon --> <div class="volume-wrapper"> <button class="ctrl-btn" id="muteBtn" style="background:transparent; width:32px; height:32px;" aria-label="Mute"> <i class="fas fa-volume-up"></i> </button> <input type="range" id="volumeSlider" class="volume-slider" min="0" max="1" step="0.02" value="0.8"> </div>

.volume-slider::-webkit-slider-thumb -webkit-appearance: none; width: 12px; height: 12px; background: #ffffff; border-radius: 50%; cursor: pointer; box-shadow: 0 0 4px #3b82f6; body background: linear-gradient(145deg

<div class="custom-controls"> <!-- Play/Pause Button --> <button class="ctrl-btn play-pause-btn" id="playPauseBtn" aria-label="Play/Pause"> <i class="fas fa-play"></i> </button>

.ctrl-btn:hover background: rgba(255, 255, 255, 0.2); transform: scale(1.02); color: white;

/* VOLUME SLIDER */ .volume-wrapper display: flex; align-items: center; gap: 8px; background: rgba(0, 0, 0, 0.4); padding: 0 0.5rem; border-radius: 40px; transition: all 0.2s cubic-bezier(0.2

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"> <title>Custom HTML5 Video Player | Sleek & Modern</title> <style> /* RESET & GLOBAL */ * margin: 0; padding: 0; box-sizing: border-box; user-select: none; /* avoid accidental selection on UI buttons */

/* TIME & SLIDER AREA */ .time-display font-family: 'JetBrains Mono', monospace; font-size: 0.9rem; background: rgba(0, 0, 0, 0.5); padding: 0.3rem 0.7rem; border-radius: 32px; letter-spacing: 0.5px; color: #e2e8f0;

/* loading / overlay (optional subtle hint) */ .video-wrapper::after content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; background: radial-gradient(circle at center, transparent 60%, rgba(0,0,0,0.1)); opacity: 0; transition: opacity 0.2s; /* small badge (just for style) */ .player-footer background: rgba(0,0,0,0.3); text-align: center; font-size: 0.7rem; padding: 0.5rem; color: #94a3b8; letter-spacing: 0.3px; border-top: 1px solid rgba(255,255,255,0.05); a color: #7aa2f7; text-decoration: none; </style> <!-- FontAwesome Icons (free CDN) for nice icons --> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css"> </head> <body>

<!-- Time display --> <div class="time-display" id="timeDisplay"> 00:00 / 00:00 </div>

/* FULLSCREEN BTN */ .fullscreen-btn font-size: 1.3rem;