awacke1 commited on
Commit
d10f254
·
1 Parent(s): 09a2b2a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -10
app.py CHANGED
@@ -7,20 +7,25 @@ def Base64CacheIt(filename):
7
  # Read the video file as bytes
8
  with open(filename, "rb") as file:
9
  video_bytes = file.read()
 
10
  # Encode the video bytes as base64
11
  video_base64 = base64.b64encode(video_bytes).decode()
12
- return video_base64
13
 
14
- video_placeholder = st.empty()
15
- video_base64 = Base64CacheIt("Walking on Bourbon Street.mp4")
 
 
 
 
 
16
 
17
- # Create the HTML video element
18
- video_html = f"""
19
- <video autoplay controls>
20
- <source src="data:video/mp4;base64,{video_base64}" type="video/mp4">
21
- Your browser does not support the video element.
22
- </video>
23
- """
24
 
25
  video_placeholder.empty()
26
  time.sleep(1)
 
7
  # Read the video file as bytes
8
  with open(filename, "rb") as file:
9
  video_bytes = file.read()
10
+
11
  # Encode the video bytes as base64
12
  video_base64 = base64.b64encode(video_bytes).decode()
 
13
 
14
+ # Create the HTML video element
15
+ video_html = f"""
16
+ <video autoplay controls width="100%">
17
+ <source src="data:video/mp4;base64,{video_base64}" type="video/mp4">
18
+ Your browser does not support the video element.
19
+ </video>
20
+ """
21
 
22
+ return video_html
23
+
24
+ # Set page layout to wide screen
25
+ st.set_page_config(layout="wide")
26
+
27
+ video_placeholder = st.empty()
28
+ video_html = Base64CacheIt("Walking on Bourbon Street.mp4")
29
 
30
  video_placeholder.empty()
31
  time.sleep(1)