Disconnect from the WebRTC Stream#
Use this page to choose between pausing a stream and fully tearing down the client connection when you embed a stream with the AppStreamer React component.
There are two related, but distinct, functions related to “stopping” the WebRTC stream with the AppStreamer React component:
stop()- pauses the WebRTC stream, but maintains the connection. It can be resumed by calling thestart()function.terminate()- completely disconnects from the WebRTC stream.
Calling the terminate() function is not a strict requirement when disconnecting from a WebRTC stream as this is typically done in conjunction with terminating the client application. It is most relevant if you want to connect the same web client instance to different Kit App streams.
Ending the client session or calling terminate() affects only the client; the streaming Kit App continues running and detects a disconnect.
Summary#
You can pause a stream with stop() or end the client session with terminate() depending on whether you plan to reconnect. When you are ready to tear down the server session, continue with Terminate the stream.