First and foremost, it seems unlikely that your servlet is actually written in JavaScript. It sounds more like we should be discussing Java instead.
It appears that you are interested in creating a live stream of your webcam. This is quite a complex task compared to regular video on demand and requires a good deal of expertise.
Instead of simply streaming from one point to another ("unicast streaming"), you are looking to set up a multicast stream where viewers can connect to a web page and watch the stream. To achieve this, you will need to capture the video feed from your webcam, encode it for streaming, and send it to a multicaster. The multicaster then distributes the stream to all connected clients. These clients can use standalone media players like Quicktime, VLC, or WMP, or they can view the stream using an embedded player on a website.
Essentially, here's what you need to do:
- Capture the webcam output and encode it for your target audience. Tools like VLC can help with this step.
- Configure a multicaster like the popular Darwin Streaming Server, which must be accessible to the public, to receive and distribute the stream.
- Provide a link to the stream's description file (rdp file) typically generated by the Darwin Streaming Server. This link will allow clients to connect to the stream. Alternatively, you can embed a player directly into your website.
This process involves not just programming but also system administration tasks. You'll need to plan for bandwidth and capacity, fine-tune the encoding settings, select the appropriate codec, and make various other decisions based on factors like your audience size, streaming purpose, and more.