Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to know if the stream is dead? #230

Open
raveena-copart opened this issue Oct 11, 2023 · 1 comment
Open

Is there a way to know if the stream is dead? #230

raveena-copart opened this issue Oct 11, 2023 · 1 comment
Labels
question Further information is requested

Comments

@raveena-copart
Copy link

Hello,

I am trying to understand if there is a way the library can tell if the requested stream is dead ?

@k-yle k-yle added the question Further information is requested label Oct 12, 2023
@k-yle
Copy link
Owner

k-yle commented Oct 12, 2023

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!'),
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants