Simple Video Editor

🎬 Simple Video Editor Tool

body { font-family: Arial, sans-serif; background: #111; color: #fff; text-align: center; } video { width: 70%; margin: 20px 0; border: 2px solid #444; } .controls { margin-top: 15px; } input, button { padding: 8px; margin: 5px; border-radius: 5px; border: none; } button { background: #ff9800; cursor: pointer; } const videoInput = document.getElementById("videoInput"); const video = document.getElementById("video"); videoInput.addEventListener("change", function () { const file = this.files[0]; if (file) { video.src = URL.createObjectURL(file); video.load(); } }); function trimPreview() { const start = parseFloat(document.getElementById("startTime").value); const end = parseFloat(document.getElementById("endTime").value); if (start >= end) { alert("End time must be greater than start time"); return; } video.currentTime = start; video.play(); const stopVideo = () => { if (video.currentTime >= end) { video.pause(); video.removeEventListener("timeupdate", stopVideo); } }; video.addEventListener("timeupdate", stopVideo); }

Comments

Popular posts from this blog