seawolf2357 commited on
Commit
eda5aa3
ยท
verified ยท
1 Parent(s): 4cebd8f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -12
app.py CHANGED
@@ -13,10 +13,6 @@ menus = {
13
  }
14
 
15
  # ์„ ํƒ๋œ ๋ฉ”๋‰ด ํ•ญ๋ชฉ์„ ์ €์žฅํ•  ๋ณ€์ˆ˜
16
- selected_menu = None
17
- selected_sub_menu = None
18
-
19
- # ๋ฉ”๋‰ด ์ƒ์„ฑ
20
  selected_menu = st.sidebar.selectbox("Menu", list(menus.keys()))
21
  selected_sub_menu = st.sidebar.selectbox("Sub Menu", menus[selected_menu])
22
 
@@ -24,12 +20,18 @@ selected_sub_menu = st.sidebar.selectbox("Sub Menu", menus[selected_menu])
24
  if selected_menu == "Free Stock" and selected_sub_menu == "Template Video":
25
  st.subheader("Template Videos")
26
 
27
- # ๋น„๋””์˜ค ํŒŒ์ผ ๊ฒฝ๋กœ ์„ค์ •
28
- video_files = [f"ex{i}.mp4" for i in range(1, 7)]
29
-
30
- # ์„ ํƒ๋œ ๋น„๋””์˜ค๋ฅผ ์ €์žฅํ•  ๋ณ€์ˆ˜
31
- selected_video = st.radio("Select a video:", video_files)
32
 
33
- # ์„ ํƒ๋œ ๋น„๋””์˜ค ์žฌ์ƒ
34
- if selected_video:
35
- st.video(selected_video)
 
 
 
 
 
 
 
 
 
13
  }
14
 
15
  # ์„ ํƒ๋œ ๋ฉ”๋‰ด ํ•ญ๋ชฉ์„ ์ €์žฅํ•  ๋ณ€์ˆ˜
 
 
 
 
16
  selected_menu = st.sidebar.selectbox("Menu", list(menus.keys()))
17
  selected_sub_menu = st.sidebar.selectbox("Sub Menu", menus[selected_menu])
18
 
 
20
  if selected_menu == "Free Stock" and selected_sub_menu == "Template Video":
21
  st.subheader("Template Videos")
22
 
23
+ # ๋น„๋””์˜ค ํŒŒ์ผ๊ณผ ์ธ๋„ค์ผ ์ด๋ฏธ์ง€ ๊ฒฝ๋กœ ์„ค์ •
24
+ video_files = ["ex1.mp4", "ex2.mp4", "ex3.mp4", "ex4.mp4", "ex5.mp4", "ex6.mp4"]
25
+ thumbnails = ["thum1.jpg", "thum2.jpg", "thum3.jpg", "thum4.jpg", "thum5.jpg", "thum6.jpg"]
 
 
26
 
27
+ # ๊ฐค๋Ÿฌ๋ฆฌ ํ˜•ํƒœ๋กœ ์ธ๋„ค์ผ ํ‘œ์‹œ
28
+ cols = st.columns(3)
29
+ for index in range(len(thumbnails)):
30
+ with cols[index % 3]:
31
+ st.image(thumbnails[index], width=100, caption=f"Video {index+1}")
32
+ if st.button(f"Play Video {index+1}", key=f"video{index+1}"):
33
+ # ์„ ํƒ๋œ ๋น„๋””์˜ค ์žฌ์ƒ
34
+ st.video(video_files[index])
35
+
36
+ # ์ฐธ๊ณ : Streamlit์€ ํ˜„์žฌ ์ด๋ฏธ์ง€ ํด๋ฆญ ์ด๋ฒคํŠธ๋ฅผ ์ง์ ‘ ์ฒ˜๋ฆฌํ•  ์ˆ˜ ์—†์œผ๋ฏ€๋กœ,
37
+ # ๋น„๋””์˜ค ์žฌ์ƒ์„ ์œ„ํ•œ ๋ฒ„ํŠผ์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.