Professional screen recording tool using modern browser Screen Capture API. Record entire screen, specific windows, or browser tabs with customizable quality settings. Features real-time preview, recording controls, and instant download. Perfect for creating tutorials, demos, and documentation.
Click "Start Recording" to begin screen capture or play a recorded video
// Basic Screen Capture API implementation async function startScreenRecording() { try { // Request screen capture permission const stream = await navigator.mediaDevices.getDisplayMedia({ video: { width: { ideal: 1920 }, height: { ideal: 1080 }, frameRate: { ideal: 30 } }, audio: true }); // Create MediaRecorder instance const mediaRecorder = new MediaRecorder(stream, { mimeType: 'video/webm;codecs=vp9', videoBitsPerSecond: 5000000 }); const chunks = []; // Handle data available event mediaRecorder.ondataavailable = (event) => { if (event.data.size > 0) { chunks.push(event.data); } }; // Handle recording stop mediaRecorder.onstop = () => { const blob = new Blob(chunks, { type: 'video/webm' }); const url = URL.createObjectURL(blob); // Create download link const a = document.createElement('a'); a.href = url; a.download = `recording-${Date.now()}.webm`; a.click(); URL.revokeObjectURL(url); }; // Start recording mediaRecorder.start(1000); // Collect data every second return { mediaRecorder, stream }; } catch (error) { console.error('Error starting screen recording:', error); throw error; } }
// Advanced recording with custom settings class ScreenRecorder { constructor(options = {}) { this.options = { video: { width: { ideal: 1920 }, height: { ideal: 1080 }, frameRate: { ideal: 30 }, cursor: 'always' }, audio: { echoCancellation: false, noiseSuppression: false, sampleRate: 44100 }, ...options }; this.mediaRecorder = null; this.stream = null; this.chunks = []; this.startTime = null; this.isRecording = false; } async start() { try { // Get display media with custom constraints this.stream = await navigator.mediaDevices.getDisplayMedia(this.options); // Choose best available codec const mimeType = this.getBestMimeType(); this.mediaRecorder = new MediaRecorder(this.stream, { mimeType, videoBitsPerSecond: this.options.videoBitrate || 5000000, audioBitsPerSecond: this.options.audioBitrate || 128000 }); this.setupEventHandlers(); this.mediaRecorder.start(1000); this.startTime = Date.now(); this.isRecording = true; return true; } catch (error) { this.handleError(error); return false; } } getBestMimeType() { const types = [ 'video/webm;codecs=vp9,opus', 'video/webm;codecs=vp8,opus', 'video/webm;codecs=h264,opus', 'video/webm', 'video/mp4' ]; return types.find(type => MediaRecorder.isTypeSupported(type)) || ''; } setupEventHandlers() { this.mediaRecorder.ondataavailable = (event) => { if (event.data.size > 0) { this.chunks.push(event.data); } }; this.mediaRecorder.onstop = () => { this.createVideoFile(); }; this.stream.getVideoTracks()[0].onended = () => { this.stop(); }; } pause() { if (this.mediaRecorder && this.mediaRecorder.state === 'recording') { this.mediaRecorder.pause(); } } resume() { if (this.mediaRecorder && this.mediaRecorder.state === 'paused') { this.mediaRecorder.resume(); } } stop() { if (this.mediaRecorder && this.isRecording) { this.mediaRecorder.stop(); this.stream.getTracks().forEach(track => track.stop()); this.isRecording = false; } } createVideoFile() { const blob = new Blob(this.chunks, { type: this.mediaRecorder.mimeType }); const duration = Date.now() - this.startTime; const filename = `screen-recording-${new Date().toISOString().slice(0, 19)}.webm`; return { blob, duration, filename }; } } // Usage const recorder = new ScreenRecorder({ video: { frameRate: { ideal: 60 } }, videoBitrate: 8000000 }); await recorder.start();
// Comprehensive error handling for screen recording class ScreenRecorderWithErrorHandling { async startRecording() { try { // Check API support first if (!this.isScreenCaptureSupported()) { throw new Error('Screen Capture API not supported'); } if (!this.isMediaRecorderSupported()) { throw new Error('MediaRecorder API not supported'); } // Request permissions with fallback options const stream = await this.requestScreenCapture(); const mediaRecorder = await this.createRecorder(stream); return { stream, mediaRecorder }; } catch (error) { this.handleRecordingError(error); throw error; } } isScreenCaptureSupported() { return navigator.mediaDevices && navigator.mediaDevices.getDisplayMedia; } isMediaRecorderSupported() { return typeof MediaRecorder !== 'undefined'; } async requestScreenCapture() { const constraints = { video: { width: { ideal: 1920 }, height: { ideal: 1080 }, frameRate: { ideal: 30 } }, audio: true }; try { return await navigator.mediaDevices.getDisplayMedia(constraints); } catch (error) { // Handle specific permission errors if (error.name === 'NotAllowedError') { throw new Error('Screen recording permission denied'); } else if (error.name === 'NotFoundError') { throw new Error('No screen capture source available'); } else if (error.name === 'NotSupportedError') { throw new Error('Screen capture not supported'); } else { throw new Error(`Screen capture failed: ${error.message}`); } } } async createRecorder(stream) { // Test codec support and choose best option const supportedTypes = [ 'video/webm;codecs=vp9,opus', 'video/webm;codecs=vp8,opus', 'video/webm;codecs=h264,opus', 'video/webm', 'video/mp4' ]; const mimeType = supportedTypes.find(type => MediaRecorder.isTypeSupported(type) ); if (!mimeType) { throw new Error('No supported video format found'); } try { return new MediaRecorder(stream, { mimeType }); } catch (error) { throw new Error(`Failed to create MediaRecorder: ${error.message}`); } } handleRecordingError(error) { console.error('Recording error:', error); // Provide user-friendly error messages const userMessage = this.getUserFriendlyErrorMessage(error); this.showErrorNotification(userMessage); } getUserFriendlyErrorMessage(error) { const errorMessages = { 'Screen recording permission denied': 'Please allow screen recording permission to continue.', 'No screen capture source available': 'No screens or windows available for recording.', 'Screen capture not supported': 'Your browser doesn\'t support screen recording.', 'No supported video format found': 'Your browser doesn\'t support video recording formats.' }; return errorMessages[error.message] || 'An unexpected error occurred during recording.'; } showErrorNotification(message) { // Show user-friendly error notification console.warn('User notification:', message); } } // Usage with error handling const recorder = new ScreenRecorderWithErrorHandling(); try { const { stream, mediaRecorder } = await recorder.startRecording(); console.log('Recording started successfully'); } catch (error) { console.log('Failed to start recording:', error.message); }
Generate common barcodes (EAN-13, UPC, Code 39, Code 128) cl...
Apply real-time visual effects to live webcam video includin...
Convert videos to animated GIFs using client-side processing...
Convert text to spoken voice using browser Web Speech API wi...
Explore comprehensive weather analysis and astronomical tracking tools for outdoor planning, health ...
Unlock the power of location intelligence with professional GIS and mapping tools. From coordinate c...
Master image optimization for faster websites and better Core Web Vitals. Discover professional tool...
Master file management and document processing with professional PDF, OCR, and conversion tools. Str...
Professional code debugging and development solutions for developers.