Handling NetStream
I'm trying to publish live webcam feed, but I noticed something odd going on.
After a connection has been made to FMS a user can press a button to start streaming. The button will simply create a netstream and attach audio/video devices to the net stream and start publishing.
If that user wants to stop publishing I have a differernt button that assigns my netstream to null. The reason why I do this is because I don't want the user to drop the connection to the server, just stop publishing.
What's weird is I think the way I'm handling netstream is causing odd things to happen in the Admin Console. If I have 2 users waiting to listen to a stream; I will have 2 clients subscribed to the stream. When a new user comes in and wants to publish the live stream it doubles the clients already subscribed and gives them another client id that is handling the stream. If the publisher then decides to stop publishing then it only removes 1 of the duplicated clients from the stream.
Here's an attempt at a visual of the admin console ![]()
Before Publishing:
AAAAAA rtmp bytesIn bytesOut <-- Viewer
AAAAAB rtmp bytesIn bytesOut <-- Viewer
After a user starts publishing:
AAAAAA rtmp bytesIn bytesOut <-- Viewer (Client ID made when a connection was made), no longer appears to be used
AAAAAB rtmp bytesIn bytesOut <-- Viewer (Client ID made when a connection was made), no longer appears to be used
AAAAAC rtmp bytesIn bytesOut <-- Publisher
AAAAAD rtmp bytesIn bytesOut <-- Duplicated Viewer that is playing the stream
AAAAAE rtmp bytesIn bytesOut <-- Duplicated Viewer that is playing the stream
After user stops publishing:
AAAAAA rtmp bytesIn bytesOut <-- Viewer (Client ID made when a connection was made), no longer appears to be used
AAAAAB rtmp bytesIn bytesOut <-- Viewer (Client ID made when a connection was made), no longer appears to be used
AAAAAC rtmp bytesIn bytesOut <-- Publisher
AAAAAE rtmp bytesIn bytesOut <-- Duplicated Viewer that was playing the stream
