Allow Streamlit server to handle Range Requests#1967
Allow Streamlit server to handle Range Requests#1967kmcgrady merged 8 commits intostreamlit:developfrom
Conversation
5365ea6 to
7a2e64a
Compare
| } | ||
|
|
||
| if (videoNode) { | ||
| videoNode.addEventListener("loadedmetadata", setStartTime) |
There was a problem hiding this comment.
Not sure if this is an use case we care about but it doesn't look like the metadata gets reloaded during reruns. Basically if you change the start_time in your script without doing a hard refresh, nothing happens.
There was a problem hiding this comment.
Discussed this. This is fine overall. I think changing start time around is a weird UX, and it will work if the src changes.
| {"path": "%s/" % file_util.get_assets_dir()}, | ||
| ), | ||
| (make_url_path_regex(base, "media/(.*)"), MediaFileHandler), | ||
| (make_url_path_regex(base, "media/(.*)"), MediaFileHandler, {"path": ""}), |
There was a problem hiding this comment.
Do we need this? Not sure what the point of an empty string provides?
There was a problem hiding this comment.
Yes, I think Tornado sends the options as keyword arguments, so when it's missing the server errors out.
There was a problem hiding this comment.
Ahh is that because now it's a static file handler?
# By karrie (7) and others # Via GitHub * develop: Removing cache option from main menu if s4a (streamlit#2149) Fix empty deploy page (streamlit#2148) Don't wait for unit tests before starting Cypress (streamlit#2142) Fix formatting of st.file_uploader docstring (streamlit#2141) Fix broken link in 0.68 changelog (streamlit#2144) Fix useEffect warning (streamlit#2137) Add global GTM container (streamlit#2128) Allow Streamlit server to handle Range Requests (streamlit#1967) rename hosted to hostedAt (streamlit#2132) Update change log Update notices Up version to 0.68.0 Rename hosted to hostedAt in tracking data (streamlit#2132) Inject tracking data (streamlit#2110) [Feature Branch] File uploader (streamlit#2130) links for docs (streamlit#2129) Upgrade ProtobufJS and fix build script (streamlit#2118) Refresh landing page (streamlit#2116) Improve docstrings + tutorials for Layout (streamlit#2117) Better 'streamlit run' error message when no extension provided (streamlit#2115) # Conflicts: # frontend/src/components/elements/Video/Video.tsx # frontend/src/components/widgets/FileUploader/FileUploader.test.tsx # frontend/src/components/widgets/FileUploader/FileUploader.tsx # frontend/src/lib/utils.ts
Issue: #1804 #1294
Description:
Browsers are beginning to require Range Requests (notably Chrome and Safari) in order to display/set the start time effectively. This change fixes adds that functionality.
The Range Request is managed will in Tornado's
StaticFileHandler, so I subclassed it and followed their convention for using theMediaFileManagervs an actual path.We also remove the 5 second timer in favor of expiring files after a script completes running or when the session is disconnected.
Contribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.