rtsp-relay
rtsp-relay copied to clipboard
Is there a way to know if the stream is dead?
trafficstars
Hello,
I am trying to understand if there is a way the library can tell if the requested stream is dead ?
Hi, from the frontend you can use the onDisconnect callback
example:
// client side code
import { loadPlayer } from 'rtsp-relay/browser';
loadPlayer({
url: `ws://${location.host}/stream`,
canvas: document.getElementById('canvas'),
// optional
onDisconnect: () => console.log('Connection lost!'),
});