Record a video automatically

Hi!
I need to add and automatic video recording button to my app.
Example:
If I click on a button or call a function, it should record automatically for 10 seconds.

And now im trying to do this with : https://ionicframework.com/docs/native/media-capture

My problem is that this open the camera app, but not record automatically, u should clik on record button and finish button.

There is a way to record automatically?

Thanks!