How can I reload programmatically the webcam srteam (#webcam_img_container content)

Hello,

Is it possible to refresh programmatically (from an octopi plugin) the content of #webcam_img_container to display the webcam's stream when the the webcam is turned on / display the webcam stream no loaded message when it's turned off without having to switch to another browser tab ?

If it is possible, what would be the proper way to achieve this ?

Here is the pseudo-code of what I would like to achieve:

user clicks on a button in octopi UI
turn on IP camera port on PDU
wait for IP camera to be up and running
when IP camera is up and runnning call some remote API to do some stuff
refresh/reload webcam stream in octopi (how can I achieve this step?)

And

user clicks on a button in octopi UI
call some remote API to prepare IP webcam shutdown
turn off IP webcam port on PDU
refresh/reload webcam stream in octopi (how can I achieve this step?)

Thank you in advance