Stop a publisher from streaming

In this guide we will look at stopping publishers from streaming to a session.

You can stop publisher from streaming to the session by unmounting it (removing it from the parent OTSession component). For example, the following code stops publishing a stream after 30 seconds:

Note that you can individually stop sending video or audio (while still publishing).

Detecting when a published stream leaves a session

The OTPublisher object dispatches a streamDestroyed event when it stops streaming to the session: