Create and destroy Peers based on call flag changes
Instead of relying on forced reconnections made by the publisher when
media was started or stopped (and there was no other media stream) now
the changes in the call flags are monitored to proactively create and
destroy Peers as needed. This will make possible to get rid of forced
reconnections in those cases (but this needs to be supported by the
mobile clients too before forced reconnections no longer need to be
triggered).
Note that, technically, even if all media streams are stopped there is
no real need to destroy the Peer object and stop the connection, as the
publisher will still keep the connection open, although with null
tracks. Nevertheless, closing the connection once no longer needed does
no harm either, and it can be started again later if needed.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Please register or sign in to comment