Radio button with video


I would like to show several videos and let the user select a video with a radio button

Steps to reproduce

        col1, col2 = st.columns(2)
        dict_video_paths = {
            index: for index, path in enumerate(video_paths)
            "select video",
            format_func=lambda x: dict_video_paths.get(x),

Expected behavior:

should show radio button and video beside it

Actual behavior:

shows radio button and video object and video

Debug info

  • Streamlit version: 1.16.0
  • Python version:3.9.13

Here is a sample code.

import streamlit as st

# Define a list of video paths.
video_paths = [

col1, col2 = st.columns(2)

# Generate a dictionary from a list so that it is easier to get the video path.
dict_video_paths = {
    f'Video {index + 1}': path for index, path in enumerate(video_paths)

# Show the buttons in column 1.
selected =
    "select video",

# Show the selected video in column 2[selected])
col2.markdown(f'### {selected}')




This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.