SamuelScheit / puppeteer-stream

A Library for puppeteer to retrieve audio and/or video streams
MIT License
335 stars 105 forks source link

[Question] How to pause recording on media buffering and re-record after media is loaded #60

Closed PradyumnTiwari closed 1 year ago

PradyumnTiwari commented 1 year ago

Hello team, Thank you so much for this awesome NPM. Currently, I am facing an issue, which is - I am recording and video by HTML video editor (which is developed by my team), there are lots of media is running at the same time. The issue is when I am recording the video, my media is buffering to load in the browser and it is also recorded, so I want to pause the recording on buffering time, and after properly loading my media starts re-recording.

Please suggest to me how to pause recording for some time and start it again. Please let me know if any input you need from my end.

Thanks in advance :)

SamuelScheit commented 1 year ago

It could be possible to use the .pause() function of the MediaRecorder api, which this package uses to record the webpage: https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/pause But you would have to look into the source code of this package to make it work.