st.column_config.VideoColumn
Configure a video column in st.dataframe or st.data_editor.
Video columns display an icon. When a user double clicks the icon in a cell, Streamlit displays playback controls. To display a video, a cell must have one of the following values:
A URL to fetch the video from. If you use static file serving, the URL can be relative to your app's URL. Otherwise, the URL must be fully qualified with a scheme, like "https://example.com/my_video.mp4".
Paths to local video files and YouTube URLs aren't supported.
A data URL containing a Base64-encoded video, like "data:video/mp4;base64,AAAA...".
Video columns aren't editable at this time. This command must be used in the column_config parameter of st.dataframe or st.data_editor.
| Function signature[source] | |
|---|---|
st.column_config.VideoColumn(label=None, *, width=None, help=None, pinned=None, alignment=None) | |
| Parameters | |
label (str or None) | The label shown at the top of the column. If this is None (default), the column name is used. |
width ("small", "medium", "large", int, or None) | The display width of the column. If this is None (default), the column will be sized to fit the cell contents. Otherwise, this can be one of the following:
If the total width of all columns is less than the width of the dataframe, the remaining space will be distributed evenly among all columns. |
help (str or None) | A tooltip that gets displayed when hovering over the column label. If this is None (default), no tooltip is displayed. The tooltip can optionally contain GitHub-flavored Markdown, including the Markdown directives described in the body parameter of st.markdown. |
pinned (bool or None) | Whether the column is pinned. A pinned column will stay visible on the left side no matter where the user scrolls. If this is None (default), Streamlit will decide: index columns are pinned, and data columns are not pinned. |
alignment ("left", "center", "right", or None) | The horizontal alignment of cell content. If this is None (default), video icons are center-aligned. |
Examples
To show the playback controls, double click a cell in the video column.
import pandas as pd import streamlit as st data_df = pd.DataFrame( { "description": [ "Get started with Streamlit", "Get started with Community Cloud", ], "video": [ "https://s3-us-west-2.amazonaws.com/assets.streamlit.io/videos/hero-video.mp4", "https://s3-us-west-2.amazonaws.com/assets.streamlit.io/videos/streamlit_sharing_silent.mp4", ], } ) st.dataframe( data_df, column_config={ "video": st.column_config.VideoColumn("Preview Video"), }, )
Tip
Want a new st.column_config.VideoColumn feature or found a bug? Browse open issues and react with a 👍 on the initial post of the ones that matter to you. Your votes help us prioritize what to work on next.
Still have questions?
Our forums are full of helpful information and Streamlit experts.