I am making this simple transcription app and everything is working pretty well except for the display of the YouTube video. When the transcription is done the app shows the user the uploaded video or audio (both of these show correctly) or the YouTube video next to the transcription.
The YouTube video shows up with a vertical scroll instead of showing the entire video inside the column. Anyone knows how could I fix this?
This is a screenshot as to how the video appears cut below
This is basically the part of the code where I display the media and the display of the uploaded video or audio has no issues. Only YouTube videos:
with media_col:
if st.session_state.media_file_data:
ext = os.path.splitext(st.session_state.original_file_name)[1].lower()
if st.session_state.input_type == "Upload File":
if ext in ['.mp3', '.wav']:
st.audio(st.session_state.media_file_data)
elif ext in ['.mp4']:
st.video(st.session_state.media_file_data)
else:
st.video(st.session_state.youtube_link)
I don’t see any obvious reason in your code. I do notice that your screenshot doesn’t quite match the code in your current app, because the left column is wider than the right, but the code shows the opposite transcription-whisper/app.py at main · Odrec/transcription-whisper · GitHub That’s probably not related, but just in case.
One thing you could try playing with is explicitly creating a container with a fixed height, and see if that helps:
I’m speculating here but the documentation of containers says that they set the height based on the height of the components they hold but maybe streamlit has issues getting the height of a video from YouTube? Just a guess
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.