File size: 610 Bytes
addff3d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import streamlit as st
import base64
import time

# Read the video file as bytes
with open("Walking On Bourbon Street.mp4", "rb") as file:
    video_bytes = file.read()

video_placeholder = st.empty()

# Encode the video bytes as base64
video_base64 = base64.b64encode(video_bytes).decode()

# Create the HTML video element
video_html = f"""
<video autoplay controls>
    <source src="data:video/mp4;base64,{video_base64}" type="video/mp4">
    Your browser does not support the video element.
</video>
"""

video_placeholder.empty()
time.sleep(1)
video_placeholder.markdown(video_html, unsafe_allow_html=True)