Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -92,14 +92,34 @@ def main_page(furniture_data):
|
|
| 92 |
with col2:
|
| 93 |
if source_video and source_video in videos_data:
|
| 94 |
video_url = videos_data[source_video]["url"]
|
| 95 |
-
st.video(video_url)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
with col3:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 97 |
if source_video and source_video in videos_data:
|
| 98 |
with st.expander(f"Show Metadata for {image_name}"):
|
| 99 |
video_metadata = videos_data[source_video]
|
| 100 |
# Convert the metadata dictionary to a DataFrame
|
| 101 |
metadata_df = pd.DataFrame(video_metadata.items(), columns=['Attribute', 'Value'])
|
| 102 |
-
st.markdown(metadata_df.to_html(index=False), unsafe_allow_html=True)
|
| 103 |
|
| 104 |
else:
|
| 105 |
st.write("Not Trending")
|
|
|
|
| 92 |
with col2:
|
| 93 |
if source_video and source_video in videos_data:
|
| 94 |
video_url = videos_data[source_video]["url"]
|
| 95 |
+
#st.video(video_url)
|
| 96 |
+
video_html = """
|
| 97 |
+
<video width="320" height="240" controls>
|
| 98 |
+
<source src="""+video_url""" type="video/mp4">
|
| 99 |
+
</video>
|
| 100 |
+
"""
|
| 101 |
+
st.markdown(video_html, unsafe_allow_html=True)
|
| 102 |
with col3:
|
| 103 |
+
table_css = """
|
| 104 |
+
<style>
|
| 105 |
+
.dataframe {
|
| 106 |
+
width: 100%;
|
| 107 |
+
max-width: 100%;
|
| 108 |
+
max-height: 200px;
|
| 109 |
+
overflow-y: auto;
|
| 110 |
+
display: block;
|
| 111 |
+
}
|
| 112 |
+
.dataframe th, .dataframe td {
|
| 113 |
+
text-align: left;
|
| 114 |
+
}
|
| 115 |
+
</style>
|
| 116 |
+
"""
|
| 117 |
if source_video and source_video in videos_data:
|
| 118 |
with st.expander(f"Show Metadata for {image_name}"):
|
| 119 |
video_metadata = videos_data[source_video]
|
| 120 |
# Convert the metadata dictionary to a DataFrame
|
| 121 |
metadata_df = pd.DataFrame(video_metadata.items(), columns=['Attribute', 'Value'])
|
| 122 |
+
st.markdown(table_css+metadata_df.to_html(index=False), unsafe_allow_html=True)
|
| 123 |
|
| 124 |
else:
|
| 125 |
st.write("Not Trending")
|