Stream pre-recorded video to simulate a real user

I managed to setup my own basic Jitsi instance, just following the docs. I have a very basic understanding how the high level components interact, have very limited knowledge about video stream and encoding, but am a quite experienced developer, used to read API docs and automate stuff via scripting. I would like to do the following.

I would like to write code, that connects to a Jitis room, simulating a real additional participant by streaming a pre-recorded video. After the video is finished, the script would leave the room, like as the real user would have disconnected.

I assume that it should be possible to get the existing rooms via XMPP and to join them. Afterwards it should probably be possible to somehow stream an existing video to the videobridge, so that it is streamend into the room. But I have no understanding of the workflow between those components.

Some staring point or high level description of what would be needed, would be very appreciated.

This is already done be jitsi-meet-torture for testing.