-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathhtml5-webcam-iframe.html
52 lines (49 loc) · 1011 Bytes
/
html5-webcam-iframe.html
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
<style>
* {
box-sizing: border-box;
}
body {
margin: 0;
font-family: monospace;
color: white;
background: #444;
}
#outer {
display: flex;
flex-direction: column;
align-items: stretch;
justify-items: stretch;
width: 100vw;
height: 100vh;
}
#outer>* {
position: relative;
}
#top {
padding: 10px;
flex: 0 0 auto;
}
#bot {
flex: 1 1 auto;
background: #222;
}
iframe {
width: 100%;
height: 100%;
position: absolute;
border: 0;
}
</style>
<div id="outer">
<div id="top">
<h1>HTML5 Camera Iframe Cross Domain</h1>
<p>
The iframe below is in other domain. If you give it permission to access
the camera or the mic it has that permission forever without having to ask again
even when used from another domain. At least in Chrome as of Chrome 59
</p>
</div>
<div id="bot">
<iframe allow="camera" src="https://twgljs.org/examples/camera.html"></iframe>
</div>
</div>