File size: 1,992 Bytes
cead143
79d2b6a
70d8d2a
 
6e8c858
 
 
cebb418
70d8d2a
 
cebb418
70d8d2a
6e8c858
 
f529a1b
 
 
f47671d
f529a1b
 
 
 
6d50abd
f529a1b
 
70d8d2a
cebb418
f529a1b
 
 
e6bc869
eda5aa3
 
5c0e140
cebb418
eda5aa3
 
84b6b16
eda5aa3
e105dd1
 
 
 
 
eda5aa3
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import streamlit as st

# ์‚ฌ์ด๋“œ๋ฐ” ํƒ€์ดํ‹€ ์„ค์ •
st.sidebar.title("ViDraft")

# ๋ฉ”๋‰ด ํ•ญ๋ชฉ๊ณผ ํ•˜์œ„ ํ•ญ๋ชฉ ์ •์˜
menus = {
    "Free Stock": ["Template Video", "Template Image", "Search Video", "Search Image"],
    "Image": ["Generation", "Face ID", "Inpainting", "Remove Background", "Studio"],
    "Video": ["Generation", "Talking Face", "Remove Background", "Studio"],
    "Sound": ["Video SFX", "Video Music", "TTS(Voice)", "Voice Clone", "Image SFX", "Image Music"],
    "Scripts": ["Script"]
}

# ์„ ํƒ๋œ ๋ฉ”๋‰ด ํ•ญ๋ชฉ์„ ์ €์žฅํ•  ๋ณ€์ˆ˜, ๊ธฐ๋ณธ๊ฐ’์œผ๋กœ None ์„ค์ •
selected_menu = None
selected_sub_menu = None

# ๋ฉ”๋‰ด ์„ ํƒ ์ฒ˜๋ฆฌ
selected_menu = st.sidebar.selectbox("Menu", list(menus.keys()))
if selected_menu:
    selected_sub_menu = st.sidebar.selectbox("Sub Menu", menus[selected_menu])

# ์—ฌ๊ธฐ์„œ๋ถ€ํ„ฐ๋Š” ์‚ฌ์šฉ์ž๊ฐ€ ์„ ํƒํ•œ ๋ฉ”๋‰ด์— ๋”ฐ๋ผ ๋‹ค๋ฅธ ๋กœ์ง์„ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค.
# 'Template Video'๊ฐ€ ์„ ํƒ๋˜์—ˆ์„ ๋•Œ ๋น„๋””์˜ค ๊ฐค๋Ÿฌ๋ฆฌ๋ฅผ ํ‘œ์‹œ
if selected_menu == "Free Stock" and selected_sub_menu == "Template Video":
    st.subheader("Template Videos")
    
    # ๋น„๋””์˜ค ๊ฐค๋Ÿฌ๋ฆฌ ๋ฐ ์„ ํƒ๋œ ๋น„๋””์˜ค ์žฌ์ƒ ๋กœ์ง์„ ์—ฌ๊ธฐ์— ๊ตฌํ˜„ํ•ฉ๋‹ˆ๋‹ค.
    # ์˜ˆ๋ฅผ ๋“ค์–ด, ๋น„๋””์˜ค ํŒŒ์ผ ๋ชฉ๋ก์„ ์ƒ์„ฑํ•˜๊ณ , ์‚ฌ์šฉ์ž๊ฐ€ ์„ ํƒํ•œ ๋น„๋””์˜ค๋ฅผ ์žฌ์ƒํ•˜๋Š” ์ฝ”๋“œ ๋“ฑ

    # ๋น„๋””์˜ค ํŒŒ์ผ๊ณผ ์ธ๋„ค์ผ ์ด๋ฏธ์ง€ ๊ฒฝ๋กœ ์„ค์ •
    video_files = ["ex1.mp4", "ex2.mp4", "ex3.mp4", "ex4.mp4", "ex5.mp4", "ex6.mp4"]
    thumbnails = ["thum1.png", "thum2.png", "thum3.png", "thum4.png", "thum5.png", "thum6.png"]
    
    # ๊ฐค๋Ÿฌ๋ฆฌ ํ˜•ํƒœ๋กœ ์ธ๋„ค์ผ ํ‘œ์‹œ
    cols = st.columns(3)
    for index, thumbnail in enumerate(thumbnails):
        with cols[index % 3]:
            st.image(thumbnail, width=200, caption=f"Video {index+1}")
            # 'Play Video' ๋ฒ„ํŠผ ์ถ”๊ฐ€
            if st.button(f"Play Video {index+1}", key=f"play_{index}"):
                # ์„ ํƒ๋œ ๋น„๋””์˜ค ์žฌ์ƒ
                st.video(video_files[index])