Hi, I'm using MediaRecorder for screen recording of canvas , along with audio. simplified code to implement screen recorder /* code starts here */ //intialise stream const canvas = document.querySelector('.main-canvas'); const stream = await navigator.mediaDevices.getUserMedia({ audio: true }); for (let track of canvas.captureStream().getTracks()) { stream.addTrack(track); } recorder = new MediaRecorder(stream); chunks = []; recorder.ondataavailable = ({ data }) => { if (data) chunks.push(data); }; recorder.start(); recorder.onstop = () => { const videoBlob = new Blob(chunks, { type: 'video/mp4' }); chunks = [] //stop mic access after use try{ for (let track of stream.getTracks()) { track?.stop(); } }catch(e){} return videoBlob; } /* code ends here */ so when i call `recorder.stop()` , the `recorder.onstop` method is not getting called sometimes randomly. And also in case when recorder.onstop is not called , recorder.ondataavailable is not called even a single time,So it returns empty Blob output. This only occurs in iOS 15 device's , it occurs randomly 40% of the times. Is there any workaround for this, or what is cause of this issue? Thanks in advance
Hi Raja, do you have any potential repro steps, even if not working 100% of the time? Do you know if this is iOS specific or also happening in MacOS? If you can reproduce the issue, can you send me a sysdiagnose (youenn@apple.com) with the information of when the bug did happen?
<rdar://problem/85532501>
Hi youenn, this iOS specific issue(only in iOS 15), this not happening in macOs or other iOS version. I've checked in all device's. I'll send you playground link to test in few minutes
Raja, can you provide that test case?
Hi Geoffrey, Sorry for the delay I didn't add code snippet because this issue didn't reproduce in my ipad, after i updated it iOS 15.2, I'll check once again and verify it For your reference, i adding code file earlier in which I faced issue. code link- https://stackblitz.com/edit/web-platform-gklpub?file=index.html hosted link - https://media-recorder-test.netlify.app/ you can check this in iOS 15.0 or 15.1 ISSUE - onStopEvent function is not called after recording is stopped Thanks for instant response, & being helpful
@raja, can you confirm whether you cannot reproduce anymore in iOS 15.2? If so, can we mark it as configuration changed?
This should now be fixed in STP 139, iOS 15.4 Beta, and macOS 12.3 Beta.