Skip to content

Conversation

@AnOctopus
Copy link
Contributor

📚 Context

Element replay, for audio and video.

  • What kind of change does this PR introduce?

    • Bugfix
    • Feature
    • Refactoring
    • Other, please describe:

🧠 Description of Changes

  • Save audio/video data in cache

  • Works almost exactly the same as image replay

    • This is a breaking API change
    • This is a visible (user-facing) change

🧪 Testing Done

  • Screenshots included
  • Added/Updated unit tests
  • Added/Updated e2e tests

@AnOctopus AnOctopus marked this pull request as ready for review November 11, 2022 23:58

@st.experimental_memo
def audio():
url = "https://www.w3schools.com/html/horse.ogg"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a possibility that using this url could be flakey?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possible, but this was copied from the st.audio e2e script, and I don't recall that one having much flake

"arrow_line_chart",
"arrow_table",
"arrow_vega_lite_chart",
"audio",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should audio and video be put into nonwidget elements?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's where they went. You might have misread the diff, since it was kinda weird

FILESYSTEM_ELEMENTS = [
"audio",
"video",
"write",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason why write is going to filesystem_elements?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It isn't. We're getting rid of that list entirely, the diff is just a little confusing because [delete these lines and move "write" down] is a smaller change than [delete the whole FS elements list and move "write" up] to the diff algorithm


@st.experimental_memo
def video():
url = "https://www.w3schools.com/html/mov_bbb.mp4"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and same answer, for st.video

@AnOctopus AnOctopus merged commit 80c23be into streamlit:develop Nov 14, 2022
@AnOctopus AnOctopus deleted the feature/video-audio-replay branch November 14, 2022 19:22
tconkling added a commit to tconkling/streamlit that referenced this pull request Nov 18, 2022
* develop: (25 commits)
  Fix CORS acronym in docstring (streamlit#5727)
  Add integration tests for Snowpark (streamlit#5543)
  Release/1.15.0 (streamlit#5720)
  Add audit_frontend_dependencies script to CODEOWNERS (streamlit#5708)
  Add label_visibility option for st.checkbox (streamlit#5705)
  Display existing column names in st.map exception and make st.map work with capital letters (streamlit#5679)
  Plotly Customization (streamlit#5681)
  Turn off theme for now (streamlit#5701)
  Add all vendored code to `make notices` (streamlit#5704)
  Audit frontend licenses (streamlit#5664)
  Surround labels in quotes (streamlit#5703)
  Add info about voting on features (streamlit#5660)
  Update issue labeling scheme to adopt new standards (streamlit#5702)
  Cached media (audio+video) replay (streamlit#5695)
  Fix docstring line wrap (streamlit#5698)
  Use specialized assertion functions (streamlit#5680)
  Release 1.14.1 (streamlit#5693)
  Image replay in cached functions (streamlit#5675)
  Add docstrings for `experimental_allow_widgets` (streamlit#5670)
  Remove `st.write` from `CachedStFunctionWarning` (streamlit#5669)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants