Closed heafox closed 4 months ago
I don't know where the problem is.
I am willing to help you, but that's not enough info, I need at least reproducible, your link is obviously a local network.
All I know is that MJPEG is some sort of cat *.jpg > meme.jpeg
. (Side note: I think that's reinvents mp4 in a bad way and throws hardware video decoding into the window)
From code there's no obvious mistakes. Here's some questions:
If there's a changes in behavior due to headers, it may be a browser thing, try to do manual fetch and see the data.
There's no fix from user side available besides using html image tag or iframe
:
WebKit doesn't allow for multipart/x-mixed-replace
XHR/Fetch.
See this mail list: https://www.mail-archive.com/webkit-dev@lists.webkit.org/msg28913.html
And mentioned source: https://github.com/WebKit/WebKit/blob/00575a1a4740a524567833f23e451e4a74be366e/Source/WebCore/loader/SubresourceLoader.cpp#L520
Also while testing I noticed that WebKit (on Windows) itself support such things and correctly parses multipart/x-mixed-replace
and does what the name implies: replaces page content, when Chromium assumes media format in such case and cannot handle other types (namely HTML).
Thank you, This is very helpful to me.
There is an issue on Safari, Windows is functioning normally.
There is no problem opening the mjpeg address directly, but loading with Flutter failed. URL: http://192.168.1.153:8080/?action=stream
After changing the content type to image/jpeg, I opened the URL directly and failed to load it, but the Flutter succeeded.
Primitive headers:
Modified headers:
Thanks