k-yle / rtsp-relay

📽 View an RTSP stream in your web browser using an express.js server
https://npm.im/rtsp-relay
MIT License
325 stars 59 forks source link

How to Stop Streaming on Client #207

Closed alfian444 closed 1 year ago

alfian444 commented 1 year ago

for streaming player I use the following code for the client side loadPlayer({ url: 'ws://' + location.host + '/api/stream', canvas: document.getElementById('canvas-player') }); how to stop streaming on the client? i tried to do $("#canvas-player").unbind() but websocket on client is still running

alfian444 commented 1 year ago
var players=loadPlayer({ url: 'ws://' + location.host + '/api/stream', canvas: document.getElementById('canvas-player') });
players.then(function(result) {
                    result.destroy()
  });