File size: 1,372 Bytes
b857ab3
 
 
 
 
19a212d
b857ab3
 
19a212d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d84233a
19a212d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b857ab3
507cf85
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
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Single File Iframe with Microphone Access</title>
</head>
<body>
  <h1>Main Page with Iframe</h1>
  
  <!-- Iframe with microphone permission -->
  <iframe 
    srcdoc="
      <!DOCTYPE html>
      <html lang='en'>
      <head>
        <meta charset='UTF-8'>
        <meta name='viewport' content='width=device-width, initial-scale=1.0'>
        <title>Iframe Content</title>
        <script>
          async function requestMicrophoneAccess() {
            try {
              const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
              document.getElementById('status').innerText = 'Microphone access granted.';
            } catch (error) {
              console.error('Microphone access denied:', error);
              document.getElementById('status').innerText = 'Microphone access denied.';
            }
          }
          window.addEventListener('load', requestMicrophoneAccess);
        </script>
      </head>
      <body>
        <h2>Iframe Content</h2>
        <p id='status'>Requesting microphone access...</p>
      </body>
      </html>
    " 
    allow="microphone" 
    width="600" 
    height="400" 
    title="Iframe with Microphone Access">
  </iframe>
  
</body>
</html>