Is there a way to start and stop recording using code?

It is indeed possible, for the moment.
See the following discussion for relevant comments:

1 Like