-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathiframe-example.html
More file actions
93 lines (89 loc) · 2.9 KB
/
iframe-example.html
File metadata and controls
93 lines (89 loc) · 2.9 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Connect App Iframe Example</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 20px;
background-color: #f5f5f5;
}
.container {
max-width: 1200px;
margin: 0 auto;
}
h1 {
color: #333;
}
.iframe-container {
position: relative;
width: 100%;
height: 0;
padding-bottom: 56.25%; /* 16:9 aspect ratio */
overflow: hidden;
background-color: #000;
border-radius: 8px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border: none;
}
.info {
margin-top: 20px;
padding: 15px;
background-color: #fff;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
code {
background-color: #f0f0f0;
padding: 2px 4px;
border-radius: 4px;
font-family: monospace;
}
</style>
</head>
<body>
<div class="container">
<h1>Connect App Iframe Example</h1>
<div class="iframe-container">
<!-- Replace the URL with your actual deployment URL -->
<iframe
src="https://comma-ai-connect-stream.vercel.app"
allow="camera; microphone; geolocation; fullscreen"
allowfullscreen
sandbox="allow-same-origin allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-downloads allow-modals allow-orientation-lock allow-pointer-lock allow-presentation allow-top-navigation"
title="Connect App">
</iframe>
</div>
<div class="info">
<h2>Implementation Details</h2>
<p>This example demonstrates how to embed the Connect app in an iframe with full functionality, including camera access.</p>
<h3>HTML Code:</h3>
<pre><code><iframe
src="http://localhost:3000"
allow="camera; microphone; geolocation; fullscreen"
allowfullscreen
sandbox="allow-same-origin allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-downloads allow-modals allow-orientation-lock allow-pointer-lock allow-presentation allow-top-navigation"
title="Connect App">
</iframe></code></pre>
<h3>Important Notes:</h3>
<ul>
<li>Replace <code>http://localhost:3000</code> with your actual deployment URL</li>
<li>The <code>allow</code> attribute is crucial for enabling camera and other permissions</li>
<li>The <code>sandbox</code> attribute with appropriate values is required for camera access in iframes</li>
<li>For production, use HTTPS to ensure all features work properly</li>
<li>Both the parent page and the iframe content must be served from the same protocol (both HTTP or both HTTPS)</li>
</ul>
</div>
</div>
</body>
</html>