Screen Recorder - XRecode

Screen Recorder Tool

Screen Recorder Tool

body { background-color: #f0f0f0; font-family: 'Arial', sans-serif; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; } .container { background-color: #ffffff; border-radius: 10px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); padding: 20px; text-align: center; width: 80%; max-width: 500px; } h1 { color: #333; } video { width: 100%; height: auto; border-radius: 10px; margin-bottom: 20px; } .buttons { display: flex; justify-content: space-around; } button { background-color: #6200ea; border: none; border-radius: 5px; color: white; cursor: pointer; font-size: 16px; padding: 10px 20px; transition: background-color 0.3s; } button:disabled { background-color: #ccc; cursor: not-allowed; } button:not(:disabled):hover { background-color: #3700b3; } let startButton = document.getElementById('startButton'); let stopButton = document.getElementById('stopButton'); let downloadButton = document.getElementById('downloadButton'); let preview = document.getElementById('preview'); let recorder; let stream; startButton.addEventListener('click', async () => { stream = await navigator.mediaDevices.getDisplayMedia({ video: true }); preview.srcObject = stream; recorder = new RecordRTC(stream, { type: 'video' }); recorder.startRecording(); startButton.disabled = true; stopButton.disabled = false; }); stopButton.addEventListener('click', () => { recorder.stopRecording(() => { let blob = recorder.getBlob(); preview.srcObject = null; preview.src = URL.createObjectURL(blob); downloadButton.href = URL.createObjectURL(blob); downloadButton.download = 'recording.webm'; downloadButton.disabled = false; }); stopButton.disabled = true; startButton.disabled = false; }); downloadButton.addEventListener('click', () => { downloadButton.disabled = true; });


Comments

Popular posts from this blog

AI Detector - Trusted AI Checker for ChatGPT, GPT4 & Gemini

LOve Calculator