We are developing a web tool to record Videos of the users screen and webcam.
Some people recording large videos longer than an hour. By using the File System Access API (in Chrome and Edge on Windows), we want to backup the recording Video to a file in the host's file system in case the browser or pc crashes.
All this is working like expected except of one side effect while closing the WritableStream (WritableStream.close()
). While closing the Stream the cursor shortly changes system wide to the windows "Working In Background" Cursor.
Does anyone know if there is any solution to prevent Chrome/Edge/Chromium from changing the cursor? Because we are recording the user's screen a cursor change every few seconds is not acceptable.
Example code:
<body>
<button onclick="selectDirectory()">Select Directory for Backup</button>
<script>
async function selectDirectory() {
const dirHandle = await window.showDirectoryPicker();
const fileHandle = await dirHandle.getFileHandle('backup.txt', { create: true });
setInterval(async () => {
const writable = await fileHandle.createWritable();
await writable.write("Test");
console.log('closing writeable...');
await writable.close(); // at this point the cursor changes
}, 1000);
}
</script>
</body>