LucianoGanga / simple-headless-chrome

Simple abstraction to use Chrome as a Headless Browser with Node JS
MIT License
217 stars 50 forks source link

Enable screen capture in a video #65

Open 2fd opened 7 years ago

2fd commented 7 years ago

You can use https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia

LucianoGanga commented 7 years ago

Nice! Thanks @2fd ! :D

I was without time to review all the issues and PR, but I'll catch up the next days, and I'll try to implement this :)

Cheers! Lucho

LucianoGanga commented 7 years ago

As a follow up for this topic, I'll post here:

I'm trying this new feature in the branch 'screencast' (https://github.com/LucianoGanga/simple-headless-chrome/blob/screencast), and I'm having some trouble getting a continuous feed of frames.

What I have at the moment is:

But the thing is that when I run the example (https://github.com/LucianoGanga/simple-headless-chrome/blob/screencast/examples/screenCapture.js) I only get 3 frames.

After this is solved, what's left is saving the screencast to a .gif file or .mp4, or whatever is better.

If anyone has an idea of why it can be only passing 3 frames, that would help a lot!

Thanks, Lucho