dturing / node-gstreamer-superficial

Superficial gstreamer binding
MIT License
130 stars 45 forks source link

A new instance is created when I use pause() and stop() don't work within websocket.io #53

Closed wewlad-dev closed 1 year ago

wewlad-dev commented 2 years ago

I am having a simple test for a pipeline where I need to control the stream play(), pause(), and stop() from a client side through websocket events. It works for the most part however, the problem is when I close the client side page (closing the socket) and reopening it I lose the ability to control the stream anymore, I can't pause it or stop it, it does however keep the pipeline running. I noticed it's like opening a new "instance" -new gstreamer window appears with paused image- when I pause() it and that's why it's no longer pausing the previous one. Note: as long as I keep the page open, I can control the stream with pause/stop here's a code snipped maybe better explains it or replicating the issue.

https://www.codepile.net/pile/WnKjKOEb

dturing commented 1 year ago

you are creating the pipelines .on("connection"), so a new pipeline is created for every new socket.io connection. If that's not what you want, try creating the pipelines outside of the on("connection") callback.

(not a gstreamer-superficial issue, closing)