Skip to content

Commit

Permalink
Set onCanPlay handler on <video /> to adjust the component height
Browse files Browse the repository at this point in the history
  • Loading branch information
whitphx committed Jan 24, 2021
1 parent fc48060 commit 1a57a97
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tiny_streamlit_webrtc/frontend/src/TinyWebrtc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@ class TinyWebrtc extends StreamlitComponentBase<State> {
return (
<div>
<button onClick={this.start}>Start</button>
<video ref={this.videoRef} autoPlay playsInline />
<video
ref={this.videoRef}
autoPlay
playsInline
onCanPlay={() => Streamlit.setFrameHeight()}
/>
</div>
)
}
Expand Down

0 comments on commit 1a57a97

Please sign in to comment.