Update index.html
Browse files- index.html +22 -45
index.html
CHANGED
|
@@ -1,50 +1,27 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
<head>
|
| 4 |
-
<meta charset="UTF-8" />
|
| 5 |
-
<title>Daily Call Example</title>
|
| 6 |
-
<link href="style.css" rel="stylesheet" />
|
| 7 |
-
</head>
|
| 8 |
-
<body>
|
| 9 |
-
<div>
|
| 10 |
-
<label for="room-url">Room URL:</label>
|
| 11 |
-
<input
|
| 12 |
-
type="text"
|
| 13 |
-
id="room-url"
|
| 14 |
-
size="50"
|
| 15 |
-
placeholder="https://yourcompany.daily.co/hello"
|
| 16 |
-
/>
|
| 17 |
-
</div>
|
| 18 |
-
<div>
|
| 19 |
-
<input type="text" id="join-token" size="50" placeholder="Optional" />
|
| 20 |
-
</div>
|
| 21 |
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
</div>
|
| 28 |
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
<select id="mic-selector">
|
| 34 |
-
<option value="" disabled selected>Select a microphone</option>
|
| 35 |
-
</select>
|
| 36 |
-
</div>
|
| 37 |
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
<div id="active-speaker">Active Speaker: None</div>
|
| 43 |
-
</div>
|
| 44 |
|
| 45 |
-
|
|
|
|
| 46 |
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import os
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
|
| 4 |
+
# Function to read the content of index.html
|
| 5 |
+
def get_index_html():
|
| 6 |
+
file_path = os.path.join(os.path.dirname(__file__), "index.html")
|
| 7 |
+
with open(file_path, "r") as f:
|
| 8 |
+
return f.read()
|
|
|
|
| 9 |
|
| 10 |
+
# Embed the HTML content directly in the Gradio app
|
| 11 |
+
def embed_html():
|
| 12 |
+
html_content = get_index_html()
|
| 13 |
+
return f"<div style='height: 600px;'>{html_content}</div>"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
+
# Create the Gradio interface with tabs
|
| 16 |
+
with gr.Blocks() as app:
|
| 17 |
+
with gr.Tab("Index HTML Tab"):
|
| 18 |
+
gr.HTML(embed_html()) # Use gr.HTML to display the HTML content
|
|
|
|
|
|
|
| 19 |
|
| 20 |
+
with gr.Tab("Second Tab"):
|
| 21 |
+
gr.Textbox(value="Content for the second tab", label="Second Tab Content")
|
| 22 |
|
| 23 |
+
with gr.Tab("Third Tab"):
|
| 24 |
+
gr.Textbox(value="Content for the third tab", label="Third Tab Content")
|
| 25 |
+
|
| 26 |
+
# Launch the Gradio app
|
| 27 |
+
app.launch()
|