st.video() in Streamlit

In Streamlit, st.video() embeds a video player directly in your app. It supports local video files, URLs (including YouTube), and raw bytes, making it useful for tutorials, dashboards, ML demos, and media apps.

Basic Syntax

st.video(data, format="video/mp4", start_time=0)    

The function has the following parameters:

Example: Play a local video file.

Python

import streamlit as st

st.title("Local Video Example")

st.video("sample_video.mp4")    

✔ Useful for tutorials, demos, and offline apps.