Called in wrong state: stable when using webrtc_streamer

Hello everyone,

A similar problem with webrtc_streamer already occurred in 2021. I was able to reproduce it again.
You can find my comment on this issue here.

Reproduction steps:
Versions:

streamlit                 1.29.0
streamlit-webrtc          0.47.1
Python 3.11.6

Environment: local

  1. Add desired_playing_state=True to webrtc_streamer in 14_programmable_source.py.
webrtc_streamer(
    key="player",
    mode=WebRtcMode.RECVONLY,
    source_video_track=video_source_track,
    media_stream_constraints={"video": True, "audio": False},
    desired_playing_state=True,
    on_change=on_change,
)
  1. Run the program with streamlit run app.py
  2. Navigate to the programmable source page.
  3. The camera opens without any errors.
  4. Click on any other page and return back to the programmable source page.
  5. The camera will return an error as it’s shown in the screenshot.

@whitphx