YouTube Share Bot Architecture

How could an external bot or service connect to a Jitsi room and share YouTube videos?

The shared videos would change depending on external input. For example, this service could have /cats and /dogs APIs that would determine what YouTube video to share.

Ideally, the video change should be as transparent as possible - from the interface, one has to stop sharing and share again if a different video has to be streamed.

The final result could also be achieved by sharing an arbitraty local video into Jitsi session with a bot. Is that possible at all?