-
Hi, I have an app that I am working on that can handle multiple cameras. I am wondering how I can ensure that the web socket connection the rtsp stream is killed when the modal gets closed |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Hi, if you initialized the player on the client side using For example: const player = await loadPlayer({
url: 'ws://' + location.host + '/api/stream',
canvas: document.getElementById('canvas')
});
player.destroy(); If you want to be certain that it works, on the server side, add Hope this helps! |
Beta Was this translation helpful? Give feedback.
-
@k-yle I noticed that .destroy() also deletes the canvas? |
Beta Was this translation helpful? Give feedback.
Hi, if you initialized the player on the client side using
loadPlayer
(see recently updated README), then you make use of thePlayer
object that is returned by that promise.For example:
If you want to be certain that it works, on the server side, add
verbose: true
toproxy({ url: "..." })
and you'll see a message printed that says"no clients left; destroying stream"
Hope this helps!