Closed hubmartin closed 2 years ago
Thanks for the bug report.
I'm actually a little surprised that MJPEG streaming works at all, I had not even thought of that. When the app displays a response as HTML, it does so in a quite simplistic way, meaning that it does not act as a browser and therefore also does not support things like running JavaScript.
I will look into the issue of the MJPEG stream remaining open in the background, and include a fix for it in the next release.
As a workaround for now I can only suggest to not use the in-app displaying of the response, and instead try to open the MJPEG-URL in a browser. Perhaps you could have your server just return the URL of the MJPEG stream, and then have a script that opens a browser, like this:
openUrl(response.body);
abort();
Or if you want to avoid having to change the server's response, you could try to parse it and extract the URL from it, like this:
const parsed = parseXML(response.body);
const url = parsed.children[1].children[1].attributes.src;
openUrl(url);
abort();
This bug is fixed in version 2.18.0, which is currently being prepared for release. It will soon become available for beta testing.
Thanks for the quick fix. I have already tested it, and it works perfectly!
This is what I'm now observing in 2.18.0 when I run the shortcut from the Android launcher.
When I exit the fullscreen window with any of the actions:
I get back to the Android launcher, and the MJPEG stream stops. I see no more data is transferred in the background. However, the window is still in the launched apps, and when I select it again, the MJPEG stream starts again. (but the HTTP/POST action with my custom HTTP header parameter is not called again, which is correct). Is this stream stopping and recovery a feature of the HTTP Shortcuts or some Android smart behaviour to stop data when the App is in the background? I'm just curious. Thanks again for the fix.
When the window is closed (regardless of how), the HTTP Shortcuts app will now make sure that all of its resources are released. This is the part that was not fully implemented prior to 2.18.0. If after this you select the window again from the launched apps, it will essentially re-create the window and thereby reopen the MJPEG connection that was previously closed. This window is only responsible for displaying data though, not for making the actual HTTP request, so it will just show the same state as before you closed it, but loading the MJPEG stream is part of that displaying.
Thanks for the explanation. I've donated to your PayPal as thanks for this awesome app. Would suggest putting the donate button higher on the page and closer to the main page ;) Feel free to close this issue.
Thanks a lot, much appreciated. I was considering moving the button somewhere else, but my humbleness and the fact that the Play Store reviewers sometimes decide that they don't like it kept me from it, so I think it's fine where it is ;).
Steps To Reproduce
Expected behavior Fullscreen tab should close when I click the X and will not run in background Actual behavior Page runs in background, in case of video stream it continue to stream in background
Context (please complete the following information):
Thanks for this awesome app and keeping it active!
Any workaround is also welcome. For now I can open garage and watch the doors very easily from Android main screen, but then I need to open Tasks and swipe up to close that app and during that time I'm already driving which is really inconvinient.
I tried scripting with wait() and abort() but with no luck. I also tried to add to my page some javascript that stops streaming after 20 seconds. It works in chrome on desktop and android, but it seems like javascript is not executed in the HTTP Shortcut fullscreen window: