File size: 784 Bytes
11b3431
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import streamlit as st
import os

def save_uploaded_file(uploaded_file):
    try:
        with open(os.path.join("uploads", uploaded_file.name), "wb") as f:
            f.write(uploaded_file.getbuffer())
        return True
    except:
        return False

st.set_page_config(page_title="Video Uploader for Hugging Face Spaces")

st.title("Video Uploader for Hugging Face Spaces")

uploaded_file = st.file_uploader("Choose a video file", type=['mp4', 'mkv', 'avi', 'mov'])
if uploaded_file is not None:
    if save_uploaded_file(uploaded_file):
        st.success("File successfully uploaded")
    else:
        st.error("Error uploading file")

# Display the HTML content
with open("index.html", "r") as f:
    html_content = f.read()
st.components.v1.html(html_content, height=600)