k-yle / rtsp-relay

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

How can I change or add stream url at client? #12

Open MinHyeong-Lee opened 3 years ago

MinHyeong-Lee commented 3 years ago

Thanks for your code ! It works well. notitle

I want to add or modify rtsp url at the client.

At your code, when creating a proxy object at server, 'url' is included together. There is any way can i switch this url??

Or is there a way to dynamically add rtsp stream at the client?

Thanks for read. I really want to do this..

k-yle commented 3 years ago

hi @MMIINNHH, yes that's possible. Here's an example:

app.ws('/api/stream', (ws, req) => proxy({
  url: req.query.url,
})(ws));

then in your frontend, you would use a URL of ws://localhost:1233/api/stream?url=rtsp://...

waleedd32 commented 2 years ago

i need also help with that, at server i have this:

const handler = proxy({ url: rtsp://.....@..../Streaming/Channels/101, verbose: false, transport: 'tcp', });

app.ws('/api/stream', handler);

i'm using Reactjs, and from there i want to add rtsp url and not in server like u have done my client:

URL } >

, how should i change these and send url from client ?

k-yle commented 2 years ago

@waleedd32 does https://github.com/k-yle/rtsp-relay/issues/12#issuecomment-770121775 not answer your question?