pikvm / ustreamer

µStreamer - Lightweight and fast MJPEG-HTTP streamer
https://pikvm.org
GNU General Public License v3.0
1.67k stars 226 forks source link

--static and mjpg_streamer compatibilty #128

Closed KwadFan closed 2 years ago

KwadFan commented 2 years ago

Hello, This is more a Question like a real Issue. But, for a Project I am working on, I would like to use my own statice files for the inbuild http server. If I use --static the inbuilt redirect dont work. My Problem is that I have to keep the redirects that you have implemented to keep mjpg_streamer compatibility. I tried with some DOM Manipulation in JS but didnt work well. Or has other strange behavior. Is there a way around this?

Regards

mdevaev commented 2 years ago

I'm sorry, I didn't understand anything. Can you show me a concrete example: what you do, what you get, what you wanted to get.

KwadFan commented 2 years ago

As an Example:

-s 127.0.0.1 -p 8080 -m MJPEG --buffers=3 --device-timeout=5 -r 1280x720 -f 30 --static=/home/pi/webcamtest/ustreamer-www/ is used to start ustreamer.

When ustreamer launches I can reach the stream via localhost:8080/ an see my Page that I created in ustreamer-www, what shows a snapshot from /snapshot and a "div" Container showing the Stream.

But if I type in my Browser http://localhost:8080/?action=stream, I get an 404 and nothing is shown. How do I do that with the ?action extention I get redirected accordingly to Stream or Snapshot without using my index.html?

KwadFan commented 2 years ago

Bildschirmfoto_2021-10-16_12-08-40

Bildschirmfoto_2021-10-16_12-09-14

KwadFan commented 2 years ago

What I try to archieve is that the lower screenshot, shows only the Stream using ?action=stream instead of my --static files.

EDIT: Like that: https://github.com/pikvm/ustreamer/blob/690d29181801569b9e6e5c33d8f4206e89923789/src/ustreamer/data/index.html#L62

mdevaev commented 2 years ago

Okay, I see. It's a bug, I'll fix it.

mdevaev commented 2 years ago

Fixed now try from master branch.

KwadFan commented 2 years ago

Thank you very much, now it works like a charm :) I apriciate your work and thank you again for ustreamer :)

mdevaev commented 2 years ago

:ok_hand: