           const stream = await navigator.mediaDevices.getDisplayMedia({
                        video: { frameRate: 1000 }, // Capture 1 frame per second
                        audio: false             // Audio is recorded by recordStart() function.
                    });

                    const video = document.createElement('video');
                    video.srcObject = stream; // From getDisplayMedia()
                    video.play();
                    const canvas = document.createElement('can