Unsubscribing from a stream (Javascript Only)

To stop playing a stream you are subscribed to, pass the Subscriber object into the unsubscribe() method of the Session object:

session.unsubscribe(subscriber);

The Subscriber object is destroyed, and the stream display is removed from the HTML DOM.