tinypilot
tinypilot copied to clipboard
Apply uStreamer workarounds on a more granular level
Several browsers have bugs that prevent them from rendering MJPEG properly, and uStreamer has two separate workarounds:
advance_headers: For Chrome/Blinkdual_final_frames: For Safari/WebKit
We're currently applying the advance_headers workaround regardless of what browser the user is running. We briefly added a second workaround in #796 but reverted it in #801.
We should use JavaScript to detect the client's browser and only apply the specific workaround for that browser. So we'd dynamically generate the src attribute for remote-screen <img> element depending on the browser:
Firefox
/stream (no workarounds)
Chrome
/stream?advance_headers=1
Safari
/stream?dual_final_frames=1