OK this works but is just creating more questions...
There are a few things you need to know first to build this into what you want...
- In the HCM331 there actually is a "Guest User" which has no password requirement. First you must go to the Administrator account and select "Permit access from guest users." Then you have to configure the Guest User options from the General User account page. Creating the Guest User account will eliminate a few of the issues you are having.
- It will take a minimum of 3 HTML files (frames) to do what you want, and maybe one more. They are (1) a display frame which shows the video; (2) a control frame which has the view selection buttons (although I just use simple text controls); and (3) a target frame to receive messages from the webcam API.
- In my implementation, I make this last frame a "dummy" of zero size so the messages do not display. You can show it if you want but you cannot omit it or you will have either those undesirable spawned windows or tabs, or (more likely) no functions.
- A fourth frame might be necessary for the audio; I have not played around with this. Sorry.
I have attached sample HTML files. As coded, these three files must be located in the same directory. As usual you need to tailor these -- provide your webcam IP and port addresses in two of them, customize the controls to your needs, etc.